Share Local Site
by @darwin7381
Share a local development server with anyone via a public URL. Use when you need to demo a site to a client, let a colleague preview your work, test on mobil...
localhost.run (zero-install, fastest to start)
Nothing to install, nothing to sign up for. Just run:
ssh -o StrictHostKeyChecking=no -R 80:localhost:3000 nokey@localhost.run
Look for the URL in the output (e.g. https://xxxxx.lhr.life). Share it immediately.
ngrok (most stable, recommended for longer sessions)
# First time only
brew install ngrok # or: npm i -g ngrok, or download from ngrok.com
ngrok config add-authtoken YOUR_TOKEN # get token from dashboard.ngrok.comStart tunnel
ngrok http 3000 # replace 3000 with your port
Get the public URL:
curl -s http://127.0.0.1:4040/api/tunnels | jq -r '.tunnels[0].public_url'
Web dashboard: http://127.0.0.1:4040
cloudflared
brew install cloudflared # first time only
cloudflared tunnel --url http://localhost:3000
| Problem | Fix |
|---------|-----|
| Invalid Host header | See framework-specific fixes above |
| ngrok token invalid | Re-copy from dashboard.ngrok.com |
| localhost.run hangs | Switch to ngrok |
| Blank page / 502 | Make sure your local dev server is running |
| Wrong project showing | Check curl localhost:4040/api/tunnels for port mapping |
| cloudflared 404 | Quick tunnels can be flaky β switch to ngrok |
clawhub install share-local-site