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.
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
ngrok http 3000executed- Agent establishes outbound TLS tunnel to ngrok cloud
- Public URL (abc123.ngrok.io) assigned
- External traffic arrives at public URL
- ngrok cloud forwards to local via tunnel
- Local response returns to external via tunnel
How It Works
ngrok agent runs locally (ngrok http 3000)
Agent opens an outbound TLS connection to the ngrok edge first (reverse tunnel)
The edge assigns a public URL
Requests to the public URL are pushed to your PC over the open connection
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