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 3000

That'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 | sh

Homebrew (macOS)

$ brew install subtunnel/tap/subtunnel

npm

$ npm install -g subtunnel

Docker

$ docker run -it subtunnel/cli http 3000

Self-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 -d

CLI 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 22

Status & Management

# List active tunnels
$ subtunnel list

# Check tunnel status
$ subtunnel status

# Stop all tunnels
$ subtunnel stop --all

Configuration

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.com

Then start all tunnels with: subtunnel start

Need help?

Join our community or check the full API reference.