Ngrok vs Cloudflare Tunnel: Which One Should You Use?
Ngrok and Cloudflare Tunnel both put your localhost on a public URL, but they make opposite trade-offs. When each wins, where Vercel fits, and when neither is the right tool.
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: fastest from zero to URL
Ngrok's pitch is speed of first success. You install one binary, run ngrok http 3000, and a public HTTPS URL appears in your terminal before you have finished reading the output. Nothing else on this page beats that.
The free tier's trade-offs show up when you share the link:
- The URL is random and temporary by default. Restart ngrok and you get a new one, which means re-sending the link to everyone who had the old one. You can claim one static ngrok domain for free, which softens this considerably.
- Visitors see an interstitial warning page on the free tier before they reach your site. For a client demo, that first impression is not yours, it is ngrok's.
- Custom domains and higher limits are paid. Reasonable for professional use, but the bill exists.
Where ngrok shines: one-off demos, webhook development (its request inspector is genuinely excellent, 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) assumes you already have a domain and that its DNS is managed by 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 are persistent. The hostname 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. Between authenticating cloudflared, creating the tunnel, and wiring the DNS route, the first URL takes fifteen minutes instead of fifteen seconds. It is also less pleasant for webhook debugging, because there is no built-in request inspector.
The short version
| ngrok (free) | Cloudflare Tunnel | |
|---|---|---|
| Time to first URL | Under a minute | Fifteen-ish minutes |
| Needs your own domain | No | Yes, on Cloudflare DNS |
| Stable URL across restarts | One free static domain | Yes, named tunnels |
| Visitor interstitial | Yes, on free tier | No |
| Custom domain | Paid | Free |
| Webhook inspection | Excellent | No built-in equivalent |
| 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.
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 runs locally 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 localhost hosting comparison.
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.
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.
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
How to Deploy AI-Built Websites in 2026: 5 Tools, 5 Steps
Deploy sites from Lovable, Bolt.new, Cursor, v0, or Claude in five steps. Finish with a live 2026 website on EU hosting, HTTPS, and your own custom domain.
Vibe Deploying: What It Means and How It Works
Vibe deploying is shipping a website by talking to an AI instead of running a build pipeline. What the term covers, how MCP makes it work, and how to try it free.
Launch a landing page with a working signup form
Validate an idea this week: let an AI build your landing page, host it on your own domain and collect signups through a form relay, no backend or mail service needed.
/home/workdir/artifacts/index.html: How to Get Your File Out
Claude saved your site to /home/workdir/artifacts/index.html. That path lives in Claude's sandbox, not on your computer. Get the file out and put it on a live URL.
From Claude Code in your terminal to a live site
Claude Code writes a finished site straight into your project folder. Here is how to get it live: the MCP one-liner, the magic-file fallback, and the redeploy loop.
AI-website online zetten: de zes valkuilen
Je AI-website online zetten lijkt de makkelijke laatste stap, maar juist hier gaat het vaak mis. Zes valkuilen die een AI-site tegenhouden, en hoe je ze vermijdt.
The Lovable-to-production checklist
The pre-launch checklist for Lovable sites: export path, build output, forms, analytics, DNS, SSL, staging and rollback. Eight checks, one boring launch.
Claude Artifact Custom Domain: Download, Host, and Launch
Download or copy your Claude artifact code, host it outside Claude, and connect a custom domain with EU hosting and automatic Let's Encrypt SSL included.
What is MCP hosting? Deploying a site via MCP
MCP hosting lets an AI agent deploy your site to a live URL, no manual upload. How deploy-via-MCP works and how to connect it in Claude, Cursor or Windsurf.
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.
Lovable Custom Domain: Deploy Your Site in 5 Minutes
Move a Lovable project off its lovable.app subdomain and onto your own domain, step by step, with EU hosting and automatic SSL. Five minutes end-to-end.
Bolt.new Project Download: Export Your Project as a ZIP
Download your Bolt.new project as a ZIP, build it locally, and deploy it to a production URL with EU hosting, a custom domain, and automatic SSL included.
GDPR AI Hosting: What AI-Built Sites Need in the EU
What GDPR AI hosting really requires: why EU-resident infrastructure matters for AI-built sites, and how to set up a compliant deploy without sales calls.