Ngrok vs Cloudflare Tunnel: Which One Should You Use?
Ngrok and Cloudflare Tunnel both put localhost on a public URL, with opposite trade-offs. When each wins, where Vercel fits, and when you need neither.
Need the link to outlive your laptop?
Build once and drop the dist/ or build/ folder into VibeDeploy: https://yourname.subsite.site in about 30 seconds, your own domain when you are ready. Free for 14 days, no card.
You have something running on localhost and you need other people to see it. Two names come up immediately: ngrok and Cloudflare Tunnel. Both solve the same problem, both are free to start with, and they make almost opposite trade-offs. This is the practical comparison, including the question people ask right after this one, which is whether Vercel does the same thing (it does not, and the difference matters), and the case where the honest answer is that you should not be using a tunnel at all.
What a tunnel actually does
Both tools work the same way underneath. A small program on your machine opens an outbound connection to the provider's network. The provider gives you a public HTTPS URL, and traffic to that URL is relayed through the open connection to the port your local server listens on. No router configuration, no port forwarding, no public IP needed.
The defining property of every tunnel: your machine is the server. Close the laptop, kill the process, lose the Wi-Fi, and the public URL dies with it. That is fine for a demo and fatal for anything you wanted to leave online. Keep that in mind for the last section.
Ngrok: fast start, best debugging tools
Ngrok's pitch is speed of first success. You install one binary, add the authtoken from your free ngrok account once, run ngrok http 3000, and a public HTTPS URL appears in your terminal before you have finished reading the output.
The trade-offs of the free account show up when you share the link:
- You get one address, and ngrok picks it. Every account comes with a dev domain that ngrok generates and you cannot change. It is tied to your account and stays stable, so the link you sent yesterday still points at your machine today, but the name is not yours to choose.
- Visitors see an interstitial page before they reach your site unless you pay. For a client demo, that first impression is not yours, it is ngrok's.
- Custom domains and higher limits are paid. The free account includes 1 GB of data transfer. Reasonable for professional use, but the bill exists.
Where ngrok shines: one-off demos, webhook development (its traffic inspector is genuinely excellent, and you can replay incoming webhooks against your local code), and situations where the person running it has no domain and no patience for setup.
Cloudflare Tunnel: more setup, more permanence
Cloudflare Tunnel (the cloudflared daemon, formerly Argo Tunnel) comes in two shapes. A Quick Tunnel needs no account and no domain: cloudflared tunnel --url http:// prints a trycloudflare.com address. The hostname changes every time you start one, and Cloudflare describes Quick Tunnels as being for testing and development, with no uptime guarantee.
The version people usually mean is the named tunnel on your own domain, and that one assumes the domain is added to Cloudflare. That is the toll gate: if your domain is not on Cloudflare, moving it there is the real setup cost, not installing the software.
Past that gate, the deal is better than ngrok's in almost every direction:
- It is free without an interstitial, including on your own domain.
demo.yourdomain.compointing at your laptop costs nothing. - Named tunnels run on your own hostname. It survives restarts; the URL you shared on Monday still works on Friday, as long as your machine is up.
- It plugs into Cloudflare Access if you want the shared URL behind a login, which is the sane way to demo something semi-confidential.
Where it loses: first-run friction for the named tunnel. Between authenticating cloudflared, creating the tunnel, and wiring the DNS route, the first URL on your own domain takes fifteen minutes instead of one. It is also less pleasant for webhook debugging: you can stream the tunnel's logs live with cloudflared tail or the Live logs tab in the dashboard, but that is a log stream, not ngrok's inspector with request replay.
The short version
| ngrok (free account) | Cloudflare Tunnel | |
|---|---|---|
| Time to first URL | About a minute, after a free sign-up | About a minute as a Quick Tunnel; fifteen-ish minutes for a named tunnel |
| Needs your own domain | No | Quick Tunnel: no. Named tunnel: yes, added to Cloudflare |
| Stable URL across restarts | Yes, one dev domain ngrok assigns | Named tunnel: yes. Quick Tunnel: no |
| Visitor interstitial | Yes, unless you pay | No |
| Custom domain | Pay-as-you-go and up | Free (named tunnel) |
| Webhook inspection | Inspector with replay | Live log stream |
| Site stays up when your machine sleeps | No | No |
Rule of thumb: ngrok for minutes, Cloudflare Tunnel for weeks. A webhook session or a one-time screen-share demo is ngrok territory. A staging URL on your own domain that a client will click all week is Cloudflare Tunnel territory, if your machine genuinely stays on. A throwaway link without signing up for anything is what a Quick Tunnel is for.
Where does Vercel fit? (It is not a tunnel)
"Ngrok vs Vercel" is a common comparison, and it is comparing a courier with a warehouse. Ngrok exposes your running machine; Vercel takes a copy of your code, builds it, and serves the result from its own servers. There is no "Vercel tunnel": the closest things are vercel dev, which replicates Vercel's environment on your own machine like any dev server, and preview deployments, which are real hosted copies of your project, not views into your laptop.
That distinction is the actual decision point. If people need to see software that is running on your machine right now, mid-development, that is a tunnel job. If people need to see the site or app itself, deploying a copy is strictly better: the URL survives your laptop, and nobody's traffic depends on your Wi-Fi. The full breakdown of tunnels versus deploy platforms, including Netlify and the EU angle, lives in our tunnel vs hosting overview.
When neither is the right answer
Here is the pattern we see constantly: someone builds a site, often with an AI tool, previews it on localhost, and reaches for a tunnel to "put it online". For a website, that is the wrong tool twice over. The tunnel URL dies with the laptop, and the laptop was never meant to be a web server.
A static site, which is what AI tools produce in most cases, does not need your machine at all. Deploying the built files to real hosting takes about as long as installing ngrok, and the result is permanent: a stable HTTPS URL, optionally your own domain, served from infrastructure that does not sleep. If that is the situation you are actually in, skip the tunnel debate entirely and read how to put localhost on a live URL, which covers the drag-and-drop deploy path on EU hosting. And if the app has a server or a database behind it, that part can run there too, as containers next to the site: see the note on apps with a backend.
Tunnels are for showing people your machine. Hosting is for giving your site a life of its own. Most "how do I share localhost" questions are secretly the second thing.
Sources
Checked on the vendors' own pages on 13 October 2026:
- ngrok pricing: the free account's assigned dev domain, the interstitial page on free HTTP/S endpoints, the 1 GB data transfer, and bring-your-own domains on Pay-as-you-go and up, not on Free or Hobbyist.
- ngrok documentation, domains: the dev domain is generated automatically and cannot be changed; choosing an ngrok domain name needs a paid plan, and a domain you own needs Pay-as-you-go or higher.
- ngrok documentation, agent CLI: an account is required to connect an agent.
- ngrok documentation, traffic inspection: inspecting and replaying requests.
- Cloudflare documentation, Quick Tunnels: no account or domain, a
trycloudflare.comhostname that changes each time, for testing and development. - Cloudflare documentation, create a tunnel: publishing an application needs a website added to Cloudflare.
- Cloudflare documentation, tunnel log streams:
cloudflared tailand the Live logs tab. - Cloudflare blog, "Free Tunnels for Everyone" (April 2021): the tunnel connection is available at no cost.
- Vercel documentation, vercel dev: replicates the Vercel deployment environment locally.
Ship your AI-built site in minutes
VibeDeploy hosts your AI-built websites in the EU with custom domains, automatic SSL, and a 14-day free trial that gets you online today.
Related reading
Localhost to Live URL: Turn Your Project into a Public Link
Turn a localhost project into a shareable live HTTPS URL. Compare a temporary tunnel with permanent EU hosting, then connect your own domain and HTTPS.
How to Deploy AI-Built Websites in 2026: The Complete Guide
Every way to get an AI-built site live in 2026: MCP deploys, a deploy guide for any chat AI, upload or GitHub, containers, and a 25-tool export matrix.
sandbox:/ index.html Does Not Open? How to See the Page ChatGPT Made
ChatGPT answered with sandbox:/
AI Sandbox File Paths: Where ChatGPT, Claude, Grok and Others Save Your File
/