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 go update your webhook settings again.
To get a stable, custom subdomain, you usually have to pay.
I got tired of this, so I decided to build my own solution using the massive edge network of Cloudflare.
Meet NPort.
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: You can claim
my-project.nport.linkfor free. No more random strings. - β‘ Fast: Powered by Cloudflare Tunnel (Argo), so it uses their global edge network.
- π Secure: Automatic HTTPS.
- π Self-Hostable: Don't trust my server? Fork the repo and deploy the backend to your own Cloudflare Workers account (Free tier) in 5 minutes.
π₯ See it in action
I recorded a quick demo showing 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
Let's say your Next.js or Express app is running on port 3000.
3. Create a Tunnel
nport 3000 -s nickpham
(The -s flag stands for subdomain)
4. Done! π
You can now access your app at https://nickpham.nport.link.
Here is what it looks like in the terminal:
As you can see, the connection is established instantly, and you get a beautiful, clean summary of your session.
Under the Hood βοΈ
For the curious technical folks, here is how NPort works:
- Client: The CLI (Node.js) creates a secure tunnel connection using the Cloudflare Tunnel protocol.
- Edge: The connection is routed through Cloudflare's nearest edge location.
- Backend: I used Cloudflare Workers (serverless) to handle the routing and subdomain logic. This ensures high availability and low latency.
Because it runs on Cloudflare Workers, the infrastructure cost is near zero, which is why I can offer this for free to the community.
Privacy & Self-Hosting π‘οΈ
Privacy is important. While NPort uses end-to-end encryption via Cloudflare, I understand that for sensitive projects, you might want full control.
NPort is fully open-source. You can fork the repository and deploy your own "Backend" on your own Cloudflare account.
- You get your own private tunnel server.
- You can use your own domain name (e.g.,
tunnel.your-company.com). - Check the
server/README.mdin the repo for instructions.
Give it a try!
I built this tool to help my own team, and I hope it helps you too.
- Github Repo: github.com/tuanngocptn/nport
- Website: nport.link
If you find it useful, please consider giving it a Star β on GitHub. It helps more developers find the tool!
Happy Coding! π©βπ»π¨βπ»


Top comments (0)