Tutorial 7: View Your Dev Server On Your Phone
The agent has built a web UI. Use the same tailnet as ccmux to open it on your phone, without deploying it.
Share with Tailscale Serve
Connect both devices to your tailnet. Start the development server in one tmux pane and note the port it prints. This Vite example uses port 5173; Astro normally uses 4321.
npm run dev
In a second pane, share that port:
tailscale serve 5173
Follow any HTTPS setup prompt, then open the printed HTTPS URL on your phone. Serve proxies to the local server without requiring it to listen on every network interface. Access follows your tailnet policy.
Keep this pane running. Press Ctrl-C in the Serve pane when you want to stop sharing. This stops the foreground Serve session without resetting unrelated Serve configuration.
See the Tailscale Serve documentation for current setup requirements and commands.
If the framework rejects the hostname
Some development servers validate the Host header. Add only the exact hostname printed by Tailscale to your framework’s allowed-host list. For Vite, see server.allowedHosts. Avoid disabling host checks globally.
If live reload fails behind the proxy, refresh the page manually or configure your framework’s WebSocket origin. You can also bind directly to the machine’s Tailscale IP. For Vite:
npm run dev -- --host "$(tailscale ip -4)"
Open the printed Tailscale IP and port on your phone over HTTP. This is carried inside Tailscale’s encrypted tunnel, but browser features requiring an HTTPS origin may be unavailable. Use Serve when you need HTTPS.
Binding to 0.0.0.0 would also expose the server on other interfaces, including your local network. Binding to the Tailscale IP keeps this example scoped to that interface. Your tailnet access policy and host firewall still apply.
The phone feedback loop
- Keep the agent in one pane, the development server in another, and Serve in a third.
- Open the HTTPS URL on your phone and refresh after each change.
- Detach from tmux with Ctrl-b d when you step away.
The link works while the host is awake, connected to Tailscale, and running both processes. Detaching tmux preserves the processes; it does not guarantee that a sleeping machine remains reachable.
Help improve ccmux
Found a bug, an unclear guide, or a translation that could read better? Contributions of any size are welcome. Open an issue or send a pull request.
Spotted an error or something out of date? Edit this page on GitHub.