PublicLocal vs ngrok: a free, open-source alternative
ngrok made "expose localhost" a one-liner, and it is a solid product. PublicLocal does the same job with two differences that matter to a lot of developers: it is fully open source, and you can run the server yourself. Updated 30 October 2026
Short version
Choose PublicLocal if you want a free public link without creating an account, an MIT-licensed tool you can read and change, or your own tunnel server on your own domain with no per-seat pricing.
Choose ngrok if you need its managed extras: traffic inspection in a dashboard, OAuth and IP policies in front of tunnels, edge load balancing, SLAs, or a global network of entry points.
Side by side
| PublicLocal | ngrok | |
|---|---|---|
| Licence | MIT, client and server | Proprietary (agent source is viewable, server is not) |
| Free use | No account; 24-hour links, 7 days signed in | Account required; free tier with limits and an interstitial page |
| Random HTTPS subdomains | Yes | Yes |
| Fixed subdomain / custom domain | Free on your own server | Paid plans |
| Self-host the server | Yes, one binary, any VPS | No |
| TCP tunnels (SSH, databases) | On your own server | Yes (paid for fixed addresses) |
| Automatic certificates | Let's Encrypt, or one wildcard via Cloudflare DNS | Managed |
| WebSockets, streaming | Yes | Yes |
| Traffic inspector | Terminal feed plus a local inspector with webhook replay | Web dashboard with replay |
| Auth in front of tunnels | Password-protected links, free | OAuth, basic auth, IP rules (paid) |
| QR code for phones | --qr | No |
| Expired-link pages with stats | Yes | No |
| Share a folder or file directly | publiclocal share ./build | No |
| Self-destructing links | --max-visits, --expires | No |
| MCP for AI assistants | Built in | No |
| Where traffic goes | publiclocal.app (London), or your server | ngrok's global edge |
| Cost | Free; self-hosting costs you a VPS (≈$5/month) | Free tier; paid plans per user |
Switching from ngrok
The commands map one to one. Install PublicLocal, then:
# ngrok # PublicLocal ngrok http 3000 publiclocal http 3000 ngrok http 3000 --domain x publiclocal http --subdomain x 3000 # own server ngrok tcp 22 publiclocal tcp 22 # own server ngrok config add-authtoken publiclocal login # optional, for 7-day links
Things to know when you switch:
- The browser notice. Like ngrok's free tier, the free PublicLocal server shows visitors a short interstitial the first time they open a link in a browser. Webhooks, APIs and
curlnever see it, and the headerPublicLocal-Skip-Warning: 1skips it. Your own server has no notice. - Link lifetime. Free links last 24 hours (7 days signed in, extendable) and keep their address across reconnects and restarts. Your own server has no expiry.
- Host header. PublicLocal passes the public hostname through unchanged, the same as ngrok, so framework host allow-lists need the tunnel name added.
- Regions. The free server is in London. If most of your visitors are elsewhere, self-host near them.
Self-hosting in two commands
This is the part ngrok cannot offer. With a domain and a small VPS:
# DNS: tunnel.example.com and *.tunnel.example.com -> your server publiclocal server --domain tunnel.example.com --tokens "$(openssl rand -hex 24)" # on your laptop PUBLICLOCAL_SERVER=tunnel.example.com PUBLICLOCAL_TOKEN=... publiclocal http --subdomain myapp 3000 Forwarding https://myapp.tunnel.example.com -> localhost:3000
Certificates, reconnects and WebSockets are handled for you. The docs cover the flags; the public-instance guide covers running a server for other people safely.
Other alternatives, honestly
Cloudflare Tunnel (cloudflared) is free and robust, but your domain has to be on Cloudflare and traffic runs through their network; the server side is not open source. frp is open source and very capable (UDP, P2P, dashboards), with more configuration to write and no automatic HTTPS. bore is tiny and open source, TCP only, no HTTPS or subdomains. localtunnel is open source but its free server is often overloaded. PublicLocal sits in the middle: ngrok-style HTTPS links and subdomains, open source, one binary, and self-hostable.
Frequently asked
Is there a free alternative to ngrok?
Yes. PublicLocal is a free, open-source alternative. Run publiclocal http 3000 to get a public HTTPS link with no account; links last 24 hours, or 7 days with GitHub sign-in. You can also self-host the server on your own domain with no limits.
Can I self-host an ngrok alternative?
Yes. PublicLocal's server is open source. Point a domain and its wildcard DNS at a small VPS, run publiclocal server --domain yourdomain.com, and clients get addresses like https://myapp.yourdomain.com with automatic Let's Encrypt certificates, plus TCP tunnels.
How do I switch from ngrok to PublicLocal?
Install PublicLocal and replace ngrok http 3000 with publiclocal http 3000. For a fixed subdomain, self-host and use --subdomain myapp. For ngrok tcp 22, self-host and use publiclocal tcp 22.