Stop paying for ngrok! ๐ Meet NPort: The Free Open Source Alternative
Source: Dev.to
The Problem ๐ซ
Weโve all been there. You are demoing a Next.js app to a client, or testing a Stripe webhook locally. You fire up ngrok, send the link, and 2โฏhours laterโฆ the session expires.
Or worse, you restart your server, and the domain changes from random-xyz.ngrok-free.app to random-abc.ngrok-free.app. You have to update your webhook settings again.
To get a stable, custom subdomain, you usually have to pay.
What is NPort? ๐
NPort is a Node.js CLI tool that exposes your localhost to the internet.
It is 100โฏ% Free, Open Source, and designed to be a โset it and forget itโ replacement for paid tunneling services.
Key Features
- ๐ธ 100โฏ% Free: No monthly fees.
- ๐ Free Custom Subdomains: Claim
my-project.nport.linkfor freeโno more random strings. - โก Fast: Powered by Cloudflare Tunnel (Argo), leveraging their global edge network.
- ๐ Secure: Automatic HTTPS.
- ๐ SelfโHostable: Fork the repo and deploy the backend to your own Cloudflare Workers account (Free tier) in minutes.

Demo ๐ฅ
A quick demo shows how fast it is to get a live HTTPS link.
How It Compares
| Feature | NPort | ngrok (Free Tier) |
|---|---|---|
| Price | Free | Free (Limited) |
| Custom Subdomain | โ Included | โ Paid feature |
| Session Time | Unlimited | โ ๏ธ Limited |
| Login Required | โ No | โ Yes |
| Open Source | โ Yes (MIT) | โ No |
How to Use It ๐ป
You need Node.js installed.
1. Install via NPM
npm install -g nport
2. Start Your Local Server
Run your Next.js, Express, or any other app on a local port (e.g., 3000).
3. Create a Tunnel
nport 3000 -s nickpham
(The -s flag stands for subdomain.)

4. Done! ๐
Your app is now accessible at https://nickpham.nport.link. The terminal shows a clean summary of the session, and the connection is established instantly.
Under the Hood โ๏ธ
Client: The CLI (Node.js) creates a secure tunnel using the Cloudflare Tunnel protocol.
Edge: Traffic is routed through Cloudflareโs nearest edge location.
Backend: Implemented with Cloudflare Workers (serverless) to handle routing and subdomain logic, ensuring high availability and low latency.
Running on Cloudflare Workers keeps infrastructure costs near zero, allowing the service to remain free.
Privacy & SelfโHosting ๐ก๏ธ
Privacy is important. While NPort uses endโtoโend encryption via Cloudflare, you can fork the repository and deploy your own backend on your own Cloudflare account.
- Own private tunnel server.
- Use your own domain (e.g.,
tunnel.your-company.com). - See
server/README.mdin the repo for deployment instructions.
Give It a Try!
GitHub Repo:
Website:
If you find it useful, consider giving it a Star โญ on GitHubโit helps more developers discover the tool.
Happy coding! ๐ฉโ๐ป๐จโ๐ป