Documentation
Everything you need to know about TunnelDev
Installation
Install TunnelDev CLI globally using npm:
npm install -g tunneldev
This makes the tunneldev command available system-wide.
Authentication
Before creating tunnels, you need to authenticate with your API key:
- Sign up at tunneldev.vercel.app/signup
- Go to your dashboard
- Copy your API key (click the "Copy" button)
- Login via CLI:
tunneldev login YOUR_API_KEY
Your API key is stored securely in ~/.tunneldev/config.json
Your First Tunnel
Start a local server (any port), then create a tunnel:
tunneldev 3000
You'll get a public URL that forwards to your localhost:
✓ Tunnel created successfully! ────────────────────────────────────── Tunnel URL: https://tunneldev.onrender.com/t/a8f3c2 Local URL: http://localhost:3000 ────────────────────────────────────── Forwarding traffic... Press Ctrl+C to stop
Share the tunnel URL with anyone. All requests will be forwarded to your localhost.
How It Works
TunnelDev uses WebSocket connections to create secure tunnels:
- Your CLI connects to TunnelDev servers via WebSocket
- A public URL is generated for your tunnel
- When someone visits the URL, the request is sent through WebSocket to your CLI
- Your CLI forwards it to your localhost
- The response travels back through the same path
Security Note
All connections use TLS encryption. Your localhost remains completely private and secure.
Tunnels
Tunnels are the core concept in TunnelDev. Each tunnel:
- Has a unique public URL
- Forwards to a specific localhost port
- Remains active while the CLI is running
- Automatically closes when you stop the CLI (Ctrl+C)
Free tier: 3 simultaneous tunnels
Pro tier: 10 simultaneous tunnels
Max/Team: Unlimited tunnels
Requests
Every HTTP request through your tunnel is logged:
[14:23:15] 1. GET /api/users → 200 OK [14:23:18] 2. POST /api/create → 201 Created
Request history is stored based on your plan:
- Free: 24 hours
- Pro/Max: 90 days
- Team: 1 year
Commands
tunneldev login <api-key>Authenticate with your API key
Example:
tunneldev login abc123def456...
tunneldev [port]Start a tunnel to localhost:port (default: 3000)
Example:
tunneldev 8080
tunneldev start [port]Same as above, explicit start command
Example:
tunneldev start 5500
tunneldev helpShow help message
Example:
tunneldev help
Options
Environment variables you can set:
TUNNELDEV_API_URLOverride the default API server URL
Default: https://tunneldev-backend.onrender.com
PORTDefault port to tunnel if not specified
Default: 3000
Webhooks
TunnelDev is perfect for testing webhooks from services like Stripe, GitHub, Twilio, etc.
Example with Stripe:
- Start your local server that handles webhooks
- Create a tunnel:
tunneldev 4000 - Copy the tunnel URL
- Add it to Stripe dashboard as your webhook endpoint
- Test payments and see webhooks arrive in real-time
Pro Tip
Keep your CLI running in a separate terminal. Use Ctrl+C only when you're done testing.
Team Sharing (Max/Team Plans)
Share tunnels with your team members:
- Multiple team members can monitor the same tunnel
- See all requests in real-time
- Comment on specific requests
- Perfect for pair programming and debugging
Available on Max (5 users) and Team (unlimited users) plans.
Troubleshooting
Error: Not authenticated
You need to login first. Run: tunneldev login <your-api-key>
Error: Local server not running on port X
Make sure your local server is actually running on that port before creating the tunnel.
Tunnel closed unexpectedly
Check your internet connection. The CLI needs to stay connected via WebSocket.
Can't install globally
Try: sudo npm install -g tunneldev (Mac/Linux) or run terminal as Administrator (Windows)