Expose your localhost to the internet with a single command.
HTTP tunnels, raw TCP tunnels, real-time dashboard. Self-hosted, open-source.
ptunnel http 3000 for web apps. ptunnel tcp 25565 for game servers, SSH, databases — any raw TCP service.
Each client gets a unique subdomain that persists across reconnects. Your URL stays the same every time.
Monitor all active tunnels, client info, request logs, and bandwidth usage from the web dashboard.
Run on your own server. Full control over your data. Works on Windows, Linux & macOS.
TCP tunnel ports are automatically opened in the OS firewall when a client connects and closed when they disconnect. Supports Windows (netsh) and Linux (ufw/iptables).
Only ws and better-sqlite3. Everything else uses Node.js built-ins.
Clone the repository and install dependencies
git clone https://github.com/Jindanet/private-tunnel.git
cd private-tunnel
npm install
npm link
Copy .env.example to .env and set your domain
cp .env.example .env
# Edit .env: set DOMAIN=your-domain.com
Run on your server machine
node server/index.js
Run on your local machine (server URL is saved after first use)
ptunnel http 3000 --server wss://your-domain.com/ws
ptunnel tcp 25565 --server wss://your-domain.com/ws