Tunnel lets you expose local servers to internet securely - ngrok alternative, compatible with SSH client.
- SSH between your server and remote host
- TLS between client and remote host
Tunnel can be created using SSH or Tunnel client
- SSH to your home machine e.g. Raspberry Pi from internet
- Self-host applications at home and access them over internet
- Public URLs to share with clients or co-workers
- Directly share files from your computer
- Download the latest tunnel release for your platform from https://github.com/labstack/tunnel/releases
- Copy the tunnel binary to somewhere on the
PATHso that it can be executed e.g.
Via Homebrew (macOS)
brew install tunnel
Via Scoop (Windows)
scoop install tunnel
If you are using the Tunnel client with custom domain, subdomain or port you would need to create a config file in your home directory:
<API_KEY>with your value
Forward HTTP/HTTPS traffic
Using Tunnel client
The above tunnel can also be created using the Tunnel client:
You can also use a reserved sudomain registered from the Dashboard:
tunnel --name <TUNNEL_NAME> 8080
<TUNNEL_NAME>with your value
ssh -R 443:localhost:8080 labstack.me
In the example above,
-R option requests the server to route HTTP traffic from
443 port on remote host to port
on local host. Client can access the local server using a randomly generated subdomain of
To use a reserved sudomain:
ssh -R 80:localhost:8080 name=<TUNNEL_NAME>,key=<API_KEY>@<HOST>
<HOST>with your values
Using Tunnel client
tunnel --tcp 1883
ssh -R 0:localhost:1883 labstack.me
To route TCP traffic use port
0 and any unused port will be assigned. Client can access the local server using a provided
labstack.me and assigned port e.g.
tcp://zoe.labstack.me:18830. To setup TLS connection, provide user as
ssh -R 0:localhost:1883 [email protected].
If tunnel is disconnected due to network issues, it will try to reconnect. For SSH, you can use autossh to maintain a persistent connection.