Documentation
Get up and running with SubTunnel in under a minute.
Quick Start
Three commands to expose your local server to the internet:
Terminal
# 1. Install SubTunnel
$ curl -fsSL https://get.subtunnel.dev | sh
# 2. Login (optional for managed service)
$ subtunnel login
# 3. Start a tunnel
$ subtunnel http 3000That's it. Your local server on port 3000 is now accessible via a public URL.
Installation
Install the SubTunnel CLI on macOS, Linux, or Windows.
macOS / Linux
$ curl -fsSL https://get.subtunnel.dev | shHomebrew (macOS)
$ brew install subtunnel/tap/subtunnelnpm
$ npm install -g subtunnelDocker
$ docker run -it subtunnel/cli http 3000Self-Host the Server
To run your own SubTunnel server, use Docker Compose:
docker-compose.yml
$ git clone https://github.com/subtunnel/subtunnel
$ cd subtunnel
$ cp .env.example .env
$ docker compose up -dCLI Usage
HTTP Tunnel
Expose a local HTTP server to the internet.
$ subtunnel http 3000
# With a custom domain
$ subtunnel http 3000 --domain api.example.com
# With basic auth
$ subtunnel http 3000 --auth "user:pass"TCP Tunnel
Expose any TCP service (databases, SSH, game servers).
# Expose PostgreSQL
$ subtunnel tcp 5432
# Expose SSH
$ subtunnel tcp 22Status & Management
# List active tunnels
$ subtunnel list
# Check tunnel status
$ subtunnel status
# Stop all tunnels
$ subtunnel stop --allConfiguration
SubTunnel can be configured via a subtunnel.yml file in your project root:
subtunnel.yml
server:
url: https://tunnel.example.com
tunnels:
web:
proto: http
addr: 3000
domain: app.example.com
api:
proto: http
addr: 8080
domain: api.example.comThen start all tunnels with: subtunnel start