Run multiple tunnels at once
Expose several local services from one machine — either via separate invocations or a single tunnels.yaml file.
You want to expose more than one local port at the same time. Common cases: a frontend on :3000 plus an API on :8080, or a webhook receiver on one subdomain plus a preview build on another.
JustTunnel supports two ways to do this: run several justtunnel processes in parallel, or declare them all in a tunnels.yaml file and let one process manage them. Both honor your plan's tunnel limit.
Option 1: separate invocations
The simplest path: one terminal pane (or tmux window) per tunnel.
1. Start each tunnel in its own shell
justtunnel 3000
justtunnel 8080
Each call opens an independent tunnel with its own subdomain. They do not interfere with each other; killing one with Ctrl-C does not affect the other.
2. Optionally pin subdomains
justtunnel 3000 --subdomain acme-frontend
justtunnel 8080 --subdomain acme-api
See Reserve a custom subdomain for the rules around reserved names.
Option 2: one process, tunnels.yaml
If you'd rather manage everything from a single shell — and you want hot-reload when you edit the file — use --config-file.
1. Write a tunnels.yaml
tunnels:
- port: 3000
name: frontend
subdomain: acme-frontend
- port: 8080
name: api
subdomain: acme-api
Each entry needs a port. name, subdomain, and password are optional.
2. Start the multi-tunnel session
justtunnel --config-file tunnels.yaml
When stdout is a terminal, the CLI launches a TUI that shows every tunnel side-by-side, with per-tunnel request logs and connection state. The file is watched for changes — adding or removing entries triggers a hot reload without restarting the process. Full details are in Use a tunnels.yaml config file.
3. Mix and match
You can pass a port arg AND a config file at the same time. The port arg becomes one extra tunnel on top of whatever the file declares:
justtunnel 3000 --config-file tunnels.yaml
Duplicate ports are deduped — if 3000 is already in tunnels.yaml, the CLI uses the file's entry and ignores the duplicate.
Verify
After starting the tunnels, hit each public URL:
curl -I https://acme-frontend.justtunnel.dev
curl -I https://acme-api.justtunnel.dev
Each should return HTTP/2 200 (or whatever your local service returns). In the TUI you'll see the request logged on the matching tunnel pane.
If your account is on the free plan and you exceed the tunnel limit, the extra tunnel is rejected with a clear plan-limit error — see Plans and limits.
Common issues
- Plan tunnel limit reached. Free-plan accounts cap at 1 concurrent tunnel; the second one fails. Upgrade or close the first tunnel.
- Port collision in
tunnels.yaml. Duplicateportentries fail validation:tunnel[N]: duplicate port <P>. Each port must be unique. - Subdomain collision across entries. Two tunnels cannot share a subdomain, even on the same account. Pick distinct names.
Related
- Use a tunnels.yaml config file — full reference for the YAML schema and hot-reload behavior.
- Reserve a custom subdomain — pin stable URLs for each tunnel.
- Plans and limits — concurrent-tunnel caps per plan.
justtunnel [port]— root command reference.