About

How Does ngrok Work? The Reverse Tunnel, and What You Actually Pay For

The idea is simple. The price is for running a public server, so frp or bore can do it yourself

Whenever a local dev server has to be shown to a phone, a webhook sender or a client for a few minutes, ngrok comes up. The idea fits in one line: you call a server on the outside first, and requests come in over that call. Knowing this also tells you whether to buy a plan or run your own.

Why it gets through firewalls

Home routers and office firewalls block connections coming in. Connections going out are usually allowed.

The ngrok agent (ngrok http 3000) opens an outbound connection to ngrok's edge as soon as it starts. The edge hands out a public URL and pushes every request for that URL down the connection that's already open. No port forwarding, no static IP. Same idea as ssh -R reverse forwarding.

TLS ends at the edge, which is why you get an https URL even though your local server speaks plain http.

One catch if your server routes by Host header: requests arrive with the public URL's Host. In our Rails repo apps are picked by appNN.localhost, so the public host has to be accepted too, or the wrong app answers.

You're not paying for the technology

I put this together from ngrok.com/pricing on 2026-09-26. Prices change, so check the official page before you rely on it.

Plan Price Gist
Free $0 1GB transfer, 20k HTTP requests/month, a warning interstitial page
Hobbyist $10/mo 5GB transfer, 100k requests/month, no interstitial
Pay-as-you-go $20/mo + usage your own domain, SSO, mTLS

On the free plan, the interstitial bites before the quotas do. A person clicks through it once. A webhook sender may get that HTML back as the response.

Stare at the table long enough and it shows what the money is for. The tunnel itself is the three paragraphs above. The price is the cost of keeping a public server up 24/7, renewing wildcard DNS and TLS certificates, and keeping that server from being abused.

ngrok (managed) Browser ngrok edge public URL · TLS cert · wildcard DNS 24/7 server · abuse handling Your PC agent → localhost:3000 HTTPS outbound first requests ride it you pay someone to run this box self-hosted (frp / bore) Browser your VPS frps / bore server DNS · certs · patches: yours Your PC frpc / bore local outbound first same tunnel idea, you run the box

Running it yourself: frp and bore

Name What it is When
frp server (frps) on a VPS, client (frpc) locally. HTTP, HTTPS, TCP, UDP a tunnel you keep, your own domain
bore a tiny TCP tunnel written in Rust plain TCP is enough, or you want to read how it works
ssh -R no install, just a VPS once in a while
Cloudflare Tunnel managed, client is cloudflared your domain is already on Cloudflare

Self-hosting moves that running cost onto you: the VPS bill, DNS, certificate renewal, security patches on a public box. My rule: a quick demo, ngrok free. Frequent webhooks that trip on the interstitial, Hobbyist. Already running a VPS and a domain, frp. I haven't yet set up frp on a VPS to compare the actual cost.

If you're figuring out how to expose a local server or where webhooks should land, ask us at https://www.negabaro.com/contact.

Architecture Diagram

🌍
External Client
Browser / Webhook
④ HTTP request →
☁️
ngrok Cloud
abc123.ngrok.io
Public URL assigned
⑤ tunnel forwarding
② outbound TLS
←
🚇 💻
My PC (behind firewall)
ngrok agent localhost:3000
Key point: ngrok agent opens an <strong>outbound connection first</strong>, so no firewall/NAT configuration needed
Flow Description
  1. ngrok http 3000 executed
  2. Agent establishes outbound TLS tunnel to ngrok cloud
  3. Public URL (abc123.ngrok.io) assigned
  4. External traffic arrives at public URL
  5. ngrok cloud forwards to local via tunnel
  6. Local response returns to external via tunnel

How It Works

1

ngrok agent runs locally (ngrok http 3000)

2

Agent opens an outbound TLS connection to the ngrok edge first (reverse tunnel)

3

The edge assigns a public URL

4

Requests to the public URL are pushed to your PC over the open connection

5

The local response goes back over the same connection

Pros

  • ✓ Works behind firewalls and NAT
  • ✓ Instant public URL with HTTPS

Cons

  • ✗ The free plan's interstitial can break webhook deliveries
  • ✗ An extra hop through the edge adds latency

Use Cases

Developing and debugging webhooks locally Checking a local page from a phone A quick demo for a client
← What Is Peer-to-Peer (P2P)? Talking Directly Without a Central Server Slack Socket Mode vs Webhooks (Events API) — How It Works, Pros and Cons →