DEV Community

Alex Chen
Alex Chen

Posted on

Quick Tip: Share Your Localhost with a Free Public URL in One Command (No Signup)

Quick Tip

Need to show a teammate your local dev server right now? Two commands, zero accounts:

# terminal 1: serve your app
python3 -m http.server 8080

# terminal 2: free public URL (single binary, no signup)
cloudflared tunnel --url http://localhost:8080
Enter fullscreen mode Exit fullscreen mode

Output:

+--------------------------------------------------------------------------------------------+
|  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
|  https://seasonal-wordfish-tries-queens.trycloudflare.com                                  |
+--------------------------------------------------------------------------------------------+
Enter fullscreen mode Exit fullscreen mode

That URL is live HTTPS, works from anywhere, and dies when you Ctrl-C. I use this for:

  • Webhook debugging (Stripe/GitHub callbacks hit my laptop directly)
  • Quick demos on a call — no deploy needed
  • Testing mobile layout on a real phone on cellular

Why not ngrok? ngrok's free tier now gates you behind an account, bandwidth limits, and nagging upgrade banners. trycloudflare.com quick tunnels need nothing — the cloudflared binary is one brew install cloudflared (or a single GitHub release download).

One caveat: quick tunnels are ephemeral and not for production. For anything permanent, Cloudflare named tunnels on the free tier give you a stable hostname.

The idea for this workflow came while pairing on a MonkeyCode-generated side project: https://ly.cyberserval.tech/iIETXiF

What's your go-to for sharing localhost — cloudflared, ngrok, or something else?

Top comments (1)

Collapse
 
topstar_ai profile image
Luis Cruz

I love how you've highlighted the simplicity and effectiveness of using cloudflared for quickly sharing localhost! It’s a great alternative to ngrok, especially with the recent limitations on their free tier. One improvement I might suggest is incorporating a way to customize the URL for better memorability during demos; it could enhance the overall user experience. If you need help implementing features related to this workflow, I’d be happy to discuss a paid collaboration. What has been your experience with using custom domains in conjunction with these tunnels?