Open your dev server on your phone

A dev server on localhost is invisible to your phone. Run it on an EnvHaven workspace and its preview address opens on any phone, with HTTPS; without one, bind it to your network or tunnel it.

Updated November 23, 2026

localhost means “this computer”, so a phone asking for it asks itself. The dev server needs an address the phone can reach, and the simplest one is a public HTTPS address that is always there.

On a workspace: the preview address

Run the dev server in an EnvHaven workspace, bound to 0.0.0.0:3000, and it is reachable at https://preview-<workspace>.envhaven.app from any device, with HTTPS, for as long as the server runs. Nothing on your laptop has to stay awake, and the link works on mobile data as well as on Wi-Fi.

The agents in the workspace know this already, because the AGENTS.md the workspace writes tells them which port the preview serves. That address serves one app at a time, on port 3000 by default. If a tool insists on another port, point the preview at any port from 1024 to 65535 with the port control in the workspace’s EnvHaven sidebar, or ask the agent to repoint it. A custom domain, added on the dashboard’s Domains page, serves the same port.

On a workspace, privately: your tailnet

With Tailscale running in the workspace, your phone reaches any port on it by the workspace’s tailnet name, such as http://my-workspace:5173, even a server listening only on localhost, and several at once (Tailscale). Nothing about them is public. Ask the agent to put the workspace on your tailnet; Keep self-hosted apps private with Tailscale has the steps it follows.

Without a workspace

Same Wi-Fi: bind to the network

Start the server on all interfaces, then open the computer’s local IP on the phone:

npm run dev -- --host 0.0.0.0     # Vite
next dev -H 0.0.0.0               # Next.js
python -m http.server 8000 --bind 0.0.0.0

It only works on the same network, without HTTPS, and only while the computer is awake.

Anywhere: a tunnel

ngrok, Cloudflare Tunnel and similar tools relay a public HTTPS address to your local port. It works from any network and is easy to share; it stops when the computer sleeps or the tunnel closes, and free plans usually change the address each run.