๐ Free & open source ngrok alternative - Tunnel localhost to the internet via Cloudflare Edge
NPort is a powerful, lightweight ngrok alternative that creates secure HTTP/HTTPS tunnels from your localhost to public URLs using Cloudflare's global edge network. No configuration, no accounts, just instant tunnels with custom subdomains!
Perfect for:
- ๐ Development environments - Share your local work instantly
- ๐ Testing webhooks - Receive webhooks from GitHub, Stripe, PayPal, etc.
- ๐ฑ Mobile testing - Test your web app on real devices
- ๐ ๏ธ API development - Debug integrations with external services
- ๐ฅ Demo to clients - Show your progress without deployment
- โก Instant Setup: One command to expose your localhost
- ๐ Custom Subdomains: Choose your own URL (e.g.,
myapp.nport.link) - ๐ Automatic HTTPS: SSL/TLS encryption via Cloudflare
- ๐ Global Edge Network: Fast connections worldwide via Cloudflare
- ๐ก WebSocket Support: Full WebSocket and Server-Sent Events support
- ๐ฏ No Configuration: Works out of the box
- ๐ป Cross-Platform: Windows, macOS, and Linux support
- ๐ 100% Free: No accounts, no limits, no paywalls
- ๐ Open Source: MIT licensed
# Global installation
npm install -g nport
# Or use npx without installation
npx nport 3000 -s myappnpm install -g git+https://github.com/tuanngocptn/nport.gitExpose port 3000 with a random subdomain:
nport 3000Output:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
NPort - Free & Open Source ngrok Alternative
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Website: https://nport.link
๐ฆ NPM: https://www.npmjs.com/package/nport
๐ป GitHub: https://github.com/tuanngocptn/nport
โ Support: https://buymeacoffee.com/tuanngocptn
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Starting Tunnel for port 3000...
โ Tunnel created!
๐ Public URL: https://user-1234.nport.link
Choose your own subdomain:
nport 3000 -s myapp
# Creates: https://myapp.nport.linkOr using long form:
nport 3000 --subdomain myapp# Next.js
npm run dev
nport 3000 -s my-nextjs-app
# React (Create React App)
npm start
nport 3000 -s my-react-app
# Vue.js
npm run dev
nport 8080 -s my-vue-app
# Express.js
node server.js
nport 3000 -s my-api# Start your local webhook receiver
node webhook-receiver.js
# Expose it to the internet
nport 4000 -s my-webhooks
# Use in GitHub webhook settings:
# https://my-webhooks.nport.link/webhook# Start your local dev server
npm run dev
# Create tunnel
nport 3000 -s mobile-test
# Open on your phone:
# https://mobile-test.nport.linknport <port> [options]| Option | Short | Description | Example |
|---|---|---|---|
<port> |
- | Local port to tunnel (default: 8080) | nport 3000 |
--subdomain |
-s |
Custom subdomain | nport 3000 -s myapp |
-s=value |
- | Alternative format | nport 3000 -s=myapp |
- You run
nport 3000 -s myapp - NPort creates a Cloudflare Tunnel
- DNS record is created:
myapp.nport.linkโ Cloudflare Edge - Cloudflared binary connects your localhost:3000 to Cloudflare
- Traffic flows through Cloudflare's global network to your machine
- On exit (Ctrl+C), tunnel and DNS are automatically cleaned up
Internet โ Cloudflare Edge โ Cloudflare Tunnel โ Your localhost:3000
(https://myapp.nport.link)
- HTTPS by default: All tunnels use SSL/TLS encryption
- Cloudflare protection: DDoS protection and security features
- Automatic cleanup: Tunnels are removed when you stop the process
- No data logging: We don't store or log your traffic
| Feature | NPort | ngrok |
|---|---|---|
| Price | 100% Free | Free tier limited |
| Custom subdomains | โ Always | โ Paid only |
| HTTPS | โ Always | โ |
| Account required | โ No | โ Yes |
| Time limits | โ None | |
| Open source | โ MIT | โ Proprietary |
| Global network | โ Cloudflare | โ ngrok Edge |
NPort automatically cleans up resources when you:
- Press Ctrl+C to exit
- Kill the process
- Terminal closes
The cleanup process:
- โ
Deletes DNS record (
myapp.nport.link) - โ Removes Cloudflare Tunnel
- โ Stops cloudflared process
If you see "Cloudflared binary not found":
npm install -g nport --forceMake sure your local server is running on the specified port:
# Check if something is listening on port 3000
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # WindowsChoose a different subdomain name:
nport 3000 -s myapp-v2The ERR Cannot determine default origin certificate path warning is harmless and can be ignored. It appears because cloudflared checks for certificate-based authentication (we use token-based instead).
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you find NPort useful, please consider supporting the project:
- โญ Star on GitHub
- โ Buy me a coffee
- ๐ฌ Share with your friends and colleagues
- ๐ Report bugs
MIT License - Feel free to use NPort in your projects!
- Created by Nick Pham ๐ป๐ณ
- Powered by Cloudflare Tunnels
- Inspired by ngrok and localtunnel
- ๐ Website: https://nport.link
- ๐ฆ NPM: https://www.npmjs.com/package/nport
- ๐ป GitHub: https://github.com/tuanngocptn/nport
- ๐ง Email: [email protected]
Made with โค๏ธ by Nick Pham
