Gallery project

📱 Mobile dev: phone → localhost

Test your local dev server from a real phone. No ngrok, no tunnels, no separate IP for your laptop. Tailscale gives your phone a path to your dev box's localhost.

Gallery Dev Workflow Intermediate ~30 min Prereqs: M3

Why this project

Real-device testing of a web app is fiddly. Same-wifi tricks break when your laptop and phone are on different networks. ngrok works but burns tunnel limits and gives random URLs that change. Tailscale Just Works — your laptop and phone are on a stable network with stable hostnames, regardless of where either is. OAuth callbacks and HTTPS-gated browser features (camera, PWA install) suddenly work in dev.

Who this helps

What you get

PHONE (any network) PRIVATE EDGE YOUR LAPTOP 📱 Safari / Chromereal-device testing 🔒 Tailscale Serve · HTTPS · real certunlocks PWA install, camera, OAuth callbacks 🛠️ dev server bound to 0.0.0.0vite --host · next dev -H 0.0.0.0 · django runserver 0.0.0.0:8000

Phone hits the laptop's tailnet hostname; Tailscale Serve provides HTTPS + cert; the dev server (bound to all interfaces) responds. OAuth callback URIs are stable across reboots, so cloud OAuth configs keep working.

Prerequisites

Steps

Confirm both devices see each other ~2 min

From either, tailscale status should list the other.

Bind your dev server to all interfaces ~3 min

By default, dev servers bind to 127.0.0.1 only — meaning only the local machine can reach them. Bind to 0.0.0.0:

  • Vite: vite --host
  • Next.js: next dev -H 0.0.0.0
  • Django: python manage.py runserver 0.0.0.0:8000
  • Flask: flask run --host=0.0.0.0
  • Most node servers: HOST=0.0.0.0 npm run dev

Reach it from your phone ~1 min

On your phone's browser, navigate to http://your-laptop:5173 (use your actual hostname/port). The page loads.

Optional: HTTPS for service workers, camera, geolocation ~5 min

Browsers gate PWA install, camera, getUserMedia to HTTPS. Tailscale Serve gives you HTTPS for free:

sudo tailscale serve --bg https http://localhost:5173

Now visit https://your-laptop.tail-abc.ts.net. Real cert, secure context, all browser features unlocked.

OAuth callbacks during dev ~5 min

Add your tailnet hostname to the OAuth app config:

# Authorized redirect URI:
https://your-laptop.tail-abc.ts.net/auth/callback

Now you can test full OAuth flows from your phone.

Verify

Common issues

Caveats

Where this leads