ngrok vs NPort vs Cloudflare Tunnels: Which Localhost Tunnel Should You Use?
You need to expose localhost to the internet. Maybe webhooks, maybe a demo, maybe mobile testing. There are now several solid options, each with different tradeoffs.
Hereâs when to use what.
The Quick Answer
| Use Case | Best Option |
|---|---|
| Quick webhook testing | NPort (free, instant, custom subdomains) |
| Demo to a client | NPort or ngrok (memorable URLs) |
| Production/always-on | Cloudflare Tunnels (free, reliable, your domain) |
| TCP tunnels (SSH, databases) | ngrok (HTTP alternatives donât support TCP) |
| Team with existing ngrok setup | ngrok (donât switch for switchingâs sake) |
| Self-hosted/airgapped | Cloudflare Tunnels or bore |
The Contenders
ngrok
The original. Battle-tested, feature-rich, but the free tier has gotten more restrictive.
Pros:
- Rock solid reliability
- TCP tunnel support (SSH, databases, etc.)
- Request inspection/replay dashboard
- Established ecosystem (integrations everywhere)
Cons:
- Custom subdomains require paid plan ($8/mo+)
- Free tier: random URLs, connection limits
- Account required
- Proprietary
Best for: Teams already paying for it, TCP tunnels, production-adjacent use cases
NPort
New open-source option using Cloudflareâs edge network.
Pros:
- 100% free, including custom subdomains
- No account required
- Instant setup (
npx nport 3000 -s myapp) - Cloudflareâs global network = fast
- Open source (MIT)
Cons:
- 4-hour tunnel limit (auto-cleanup)
- HTTP/HTTPS only (no TCP)
- Newer project, smaller community
- Shared backend (can self-host)
Best for: Webhook testing, quick demos, anyone who wants custom subdomains without paying
Cloudflare Tunnels (cloudflared)
Free tunnels from Cloudflare, but requires more setup.
Pros:
- Free forever, no limits
- Use your own domain
- Always-on tunnels (runs as service)
- Full Cloudflare security stack (DDoS, WAF, etc.)
- Access control policies
Cons:
- Requires Cloudflare account
- More setup than one-liners
- Need to manage your own domain/DNS
- Dashboard can be confusing
Best for: Production services, always-on tunnels, security-conscious setups
localtunnel
The OG open-source option. Still works, but showing its age.
Pros:
- Simple (
lt --port 3000) - Open source
- No account
Cons:
- Reliability issues (server capacity)
- Slower than Cloudflare-based options
- Less actively maintained
- Random subdomains on free server
Best for: Quick one-offs when you donât want to install anything else
bore
Minimal, self-hostable Rust tunnel.
Pros:
- Tiny binary, no dependencies
- Self-host the server easily
- Open source
Cons:
- No managed service (must self-host)
- Minimal features
- No HTTPS termination (bring your own)
Best for: Self-hosters who want full control, airgapped environments
Feature Comparison
| Feature | ngrok | NPort | CF Tunnels | localtunnel | bore |
|---|---|---|---|---|---|
| Free tier | Limited | Full | Full | Full | Full |
| Custom subdomain | Paid | Free | Your domain | Limited | Self-host |
| Account required | Yes | No | Yes | No | No |
| TCP support | Yes | No | Yes | No | Yes |
| Always-on | Yes | 4hr limit | Yes | Yes | Yes |
| Self-hostable | No | Yes | N/A | Yes | Yes |
| Request inspection | Yes | No | Via dashboard | No | No |
| Open source | No | MIT | Client only | MIT | MIT |
Use Case Deep Dives
Webhook Development (Stripe, GitHub, etc.)
Winner: NPort
Youâre testing Stripe webhooks. You need a public URL for 30 minutes while you debug.
npx nport 4000 -s stripe-webhooks
# â https://stripe-webhooks.nport.link
Paste that into Stripeâs dashboard, test, done. Custom subdomain means you donât have to update the URL every time you restart.
ngrok works too, but youâll get a random URL on free tier, which is annoying when youâre iterating.
Demo to a Client
Winner: NPort or ngrok
You want https://acme-demo.nport.link not https://a1b2-203-45-67-89.ngrok-free.app.
NPort gives you this free. ngrok requires a paid plan.
If the demo needs to stay up for days, use Cloudflare Tunnels with your own domain.
Mobile Testing on Real Devices
Winner: NPort
Testing your responsive site on a real phone? Same as webhooksâyou need a public URL your phone can hit.
npm run dev
nport 3000 -s mobile-test
# Open https://mobile-test.nport.link on your phone
Production Service Behind NAT
Winner: Cloudflare Tunnels
Your home server or Raspberry Pi needs to be accessible from the internet. This is always-on, needs reliability, might need access controls.
Cloudflare Tunnels is free and designed for this:
- Runs as a system service
- Survives reboots
- Use your own domain
- Add Cloudflare Access for authentication
- DDoS protection included
SSH Access to Remote Machine
Winner: ngrok
Need to SSH into a machine behind NAT? Only ngrok does TCP tunnels on the free tier:
ngrok tcp 22
# â tcp://0.tcp.ngrok.io:12345
ssh [email protected] -p 12345
NPort and localtunnel are HTTP-only.
Cloudflare Tunnels can do this via cloudflared access but requires more setup.
Team Development Environment
Winner: Depends on budget
Budget: NPort or Cloudflare Tunnels. Both free, both work.
Paying: ngrok Team. Request inspection, replay, shared URLs, proper support.
CI/CD Integration Testing
Winner: Cloudflare Tunnels
Your CI needs to expose a test server for E2E tests that involve external services.
Cloudflare Tunnels can be scripted, runs headless, and is free. ngrok works but free tier limits might bite you in CI.
My Setup
For what itâs worth, hereâs what I use:
- NPort for quick webhook testing and demos (90% of my tunneling needs)
- Cloudflare Tunnels for always-on services (home lab stuff)
- ngrok rarely nowâonly when I need TCP tunnels
The shift happened when NPort launched with free custom subdomains. That was the main thing I was paying ngrok for.
Frequently Asked Questions
Which is fastest?
NPort and Cloudflare Tunnels both use Cloudflareâs edge network, so theyâre comparable and generally fast globally. ngrok has its own edge network which is also solid. localtunnel can be slower due to server capacity. For most use cases, the difference is negligible.
Which is most reliable for production?
Cloudflare Tunnels. Itâs designed for always-on services, runs as a system daemon, auto-reconnects, and has Cloudflareâs infrastructure backing it. ngrok paid tiers are also production-grade. NPortâs 4-hour limit makes it unsuitable for production.
Can I use my own domain?
Cloudflare Tunnels: Yes, thatâs the primary way it works. ngrok: Yes, on paid plans. NPort: Only if you self-host the backend. localtunnel: Not really.
Which should I use for a hackathon?
NPort. Instant setup, free custom subdomains for memorable demo URLs, no account signup. npx nport 3000 -s team-awesome and youâre live.
Is any of this safe for sensitive data?
All traffic is encrypted (HTTPS/TLS). But youâre routing through third-party infrastructure. For truly sensitive workloads, self-host (Cloudflare Tunnels, bore) or use a VPN instead of public tunnels.
What about Tailscale Funnel?
Good option if youâre already using Tailscale. Itâs free, uses your Tailscale identity, and integrates with their access controls. Requires Tailscale setup though, so itâs not as instant as the others for one-off needs.