CONCEPT Cited by 1 source
Ephemeral preview URL¶
Definition¶
An ephemeral preview URL is a publicly-reachable URL — typically on a platform-owned subdomain — that points at a bound port inside an ephemeral development or session environment, produced without an explicit deploy step. The URL lives as long as the environment does and dies with it.
The canonical recent instance is
Phoenix.new's *.phx.run URLs
(2025-06-20):
They have private, shareable URLs (we detect anything the agent generates with a bound port and give it a preview URL underneath
phx.run, with integrated port-forwarding).(Source: sources/2025-06-20-flyio-phoenixnew-remote-ai-runtime-for-phoenix)
What makes it a primitive¶
The pain point this fixes is the delay between code working locally and code being reachable as a URL someone else can open. Karpathy's quote (which the Fly.io post cites explicitly): writing a restaurant-menu-visualizer app "working in an afternoon" vs "getting the app online took him a whole week."
Three conditions make an ephemeral preview URL possible:
- The app runs on the platform. Because the session VM is on Fly's substrate, its ports are already reachable via Fly's routing fabric (systems/fly-proxy).
- The platform detects bound ports. The runtime (or a sidecar) watches for listening sockets and produces URLs automatically.
- The platform owns a shareable subdomain.
phx.runis a platform-owned domain; routing<session>.phx.runto the right session VM is the platform's problem, not the developer's.
Contrast with adjacent shapes¶
- Per-PR preview environments (patterns/ephemeral-preview-environments) — similar spirit (each change gets a disposable URL) but deploy-driven; CI spins up a preview on each PR. Ephemeral preview URLs on cloud IDEs skip the deploy step entirely: binding a port is the deployment.
- Local
ngroktunnels — same result (expose a local port publicly) but on laptop-run code, with a point-to-point tunnel rather than platform routing. - Codespaces port forwarding — GitHub Codespaces has the same shape; binding a port inside a codespace publishes an authenticated preview URL. Same class of primitive.
- Replit / Gitpod / StackBlitz preview — all instances.
Why agentic workflows care¶
Coding agents verifying UI changes need the URL to be reachable
from their own tools. Phoenix.new's agent drives its own browser
against the preview URL — the agent's verification loop wants the
URL as much as the human does. And because any other .phx.run
tab the developer has open also updates live (as noted in the
post), the preview URL is simultaneously an agent tool and a
human-observer surface.
Caveats¶
- Phoenix.new says "private, shareable URLs" without detailing
auth: are
.phx.runURLs token-guarded against drive-by access, or security-by-obscurity on an unguessable subdomain? The post doesn't specify. - Port-forward routing from
*.phx.runthrough systems/fly-proxy to the specific session Machine is gestured at, not sketched. - Session lifetime determines URL lifetime. If a session is torn down mid-review, the shared URL stops working; different ephemeral-preview products handle this differently (Codespaces lets workspaces sleep and resume; Phoenix.new's posture is not disclosed).
- Binding a port triggers URL creation automatically — which is convenient, but means accidentally listening on a debug port also produces a public URL. Trust scoping matters.
Seen in¶
- sources/2025-06-20-flyio-phoenixnew-remote-ai-runtime-for-phoenix
— canonical statement.
*.phx.runURLs from any bound port in the session VM.
Related¶
- concepts/cloud-ide — the product category.
- concepts/ephemeral-dev-environment — the session shape.
- concepts/async-agent-workflow — the async workflow the preview URL serves.
- systems/phoenix-new — canonical production instance.
- systems/fly-machines — session substrate.
- systems/fly-proxy — routing fabric.
- patterns/ephemeral-preview-url-via-port-forward — the design pattern this concept describes.
- patterns/ephemeral-preview-environments — adjacent shape (per-PR deploy preview; different trigger, similar result).