ngrok vs NPort vs Cloudflare Tunnels: Which Localhost Tunnel Should You Use?

By Prahlad Menon 4 min read

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 CaseBest Option
Quick webhook testingNPort (free, instant, custom subdomains)
Demo to a clientNPort or ngrok (memorable URLs)
Production/always-onCloudflare Tunnels (free, reliable, your domain)
TCP tunnels (SSH, databases)ngrok (HTTP alternatives don’t support TCP)
Team with existing ngrok setupngrok (don’t switch for switching’s sake)
Self-hosted/airgappedCloudflare 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

FeaturengrokNPortCF Tunnelslocaltunnelbore
Free tierLimitedFullFullFullFull
Custom subdomainPaidFreeYour domainLimitedSelf-host
Account requiredYesNoYesNoNo
TCP supportYesNoYesNoYes
Always-onYes4hr limitYesYesYes
Self-hostableNoYesN/AYesYes
Request inspectionYesNoVia dashboardNoNo
Open sourceNoMITClient onlyMITMIT

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.