Mekong Tunnel Logo
MEKONG

Getting Started

What is MekongTunnel and how to get up and running in under a minute.

Getting Started

MekongTunnel is a self-hosted SSH tunnel server written in Go. It works like ngrok or Cloudflare Tunnel, but you control it.

Run one command and expose any local port to the internet with a public HTTPS URL:

mekong 3000

You get:

  • A unique public URL: https://happy-tiger-a1b2.mekongtunnel.dev
  • The URL copied to your clipboard automatically
  • A QR code printed in your terminal
  • Live HTTP request logs streamed to your terminal
  • Auto-reconnect if the connection drops

New in v1.4.0+:

  • Run in the background: mekong -d 3000
  • Check tunnel status: mekong status
  • Stop a background tunnel: mekong stop 3000

New in v1.4.4:

  • Tunnel expiry support with -e and --expire
  • Raw SSH can also request expiry
  • Tunnel banner/output and mekong status now show expiry
  • Idle timeout follows the requested expiry
  • Older servers now show a clear upgrade message instead of reconnecting forever

New in v1.4.6:

  • Daemon management release with mekong logs and mekong logs -f
  • Filter daemon logs by local port with mekong logs 3000 and mekong logs -f 3000
  • Stop one daemon tunnel with mekong stop 3000 or stop everything with mekong stop --all
  • mekong status now supports per-port daemon state and shows PID info for active tunnels
  • Stopping a tunnel clears old logs for that port, and mekong stop --all clears the daemon log file

New in v1.4.5:

  • Stability and deployment fixes so expiry works correctly in production
  • Updated macOS install steps to use sudo xattr
  • Added mekongtunnel version for server version checking

Prerequisites

  • macOS, Linux, or Windows
  • A running local service on any port

That's it. No account. No config file. No dashboard.

Quick start

Step 1 โ€” Install the CLI

sudo curl -L https://github.com/MuyleangIng/MekongTunnel/releases/download/v1.4.6/mekong-darwin-arm64 -o /usr/local/bin/mekong
sudo chmod +x /usr/local/bin/mekong
sudo xattr -d com.apple.quarantine /usr/local/bin/mekong

See the Installation page for all platforms.

Step 2 โ€” Start a local server (or use your existing app)

python3 -m http.server 3000

Step 3 โ€” Open a tunnel

mekong 3000 --expire 1w

You'll see the banner with your public URL within seconds. If you want the default lifetime, just run mekong 3000.

What happens under the hood

When you run mekong 3000, the CLI:

  1. Connects to mekongtunnel.dev over SSH on port 22
  2. Sends a tcpip-forward request to ask the server to forward traffic
  3. The server assigns you a memorable subdomain and starts listening
  4. A public HTTPS URL is displayed in your terminal
  5. Incoming requests are forwarded to your localhost:3000 via the SSH channel

See How It Works for a full technical walkthrough.

Next steps