Skip to content

Quickstart

This path assumes you have a Linux edge server, a DNS zone you control, and SSH access from the client machine to the edge. Replace tunnel.example.com and mytunnel-edge with your domain and SSH alias or user@host.

Create a wildcard record where your DNS zone is hosted:

*.tunnel.example.com A <EDGE_IPV4>
*.tunnel.example.com AAAA <EDGE_IPV6> # optional

The DNS provider matters for ACME DNS challenge support. It is the provider hosting the zone, not necessarily the registrar where you bought the domain.

Use local Go when available:

Terminal window
git clone <repo-url> tunneled
cd tunneled
make build

Or build with Docker:

Terminal window
git clone <repo-url> tunneled
cd tunneled
mkdir -p bin
docker run --rm -v "$PWD":/workspace -w /workspace golang:1.25 \
sh -lc 'export PATH=/usr/local/go/bin:$PATH; go build -o bin/mytunnel ./cmd/mytunnel && go build -o bin/mytunneld ./cmd/mytunneld'

Check the version that was built:

Terminal window
cat VERSION
./bin/mytunnel --version
./bin/mytunneld --version

Copy or build the repo on the edge, then run the installer as root. The default Caddy path is opinionated for Infomaniak DNS.

Terminal window
cd ~/tunneled
sudo ./scripts/install-edge.sh \
--base-domain tunnel.example.com \
--binary ./bin/mytunneld \
--infomaniak-token '<INFOMANIAK_API_TOKEN>'

If your DNS provider is not Infomaniak, use --skip-caddy, install Caddy with the right DNS module, then run the edge bootstrap.

Terminal window
sudo ./scripts/install-edge.sh \
--base-domain tunnel.example.com \
--binary ./bin/mytunneld \
--skip-caddy

On the client/source machine:

Terminal window
cd ~/tunneled
./scripts/install-local.sh --binary ./bin/mytunnel

The script installs /usr/local/bin/mytunnel. It uses sudo if the current user is not root.

On the edge:

Terminal window
sudo ./scripts/check-edge.sh

On the client:

Terminal window
./scripts/check-client.sh --edge mytunnel-edge

check-edge.sh and check-client.sh report issues without changing firewall, SSH, Caddy, or daemon configuration.

If you do not already have an app on port 3000, start a temporary one:

Terminal window
python3 -m http.server 3000

In another terminal, start the tunnel:

Terminal window
mytunnel http 3000 --edge mytunnel-edge --base-domain tunnel.example.com --name portal

Expected output:

url: https://portal.tunnel.example.com
lease: <id>

Open the URL. The first TLS request can take a few seconds while Caddy completes certificate issuance.

Press Ctrl-C in the mytunnel http terminal. The client retries lease release on shutdown.

If a stale lease remains, remove it:

Terminal window
mytunnel ls --edge mytunnel-edge
mytunnel rm portal --edge mytunnel-edge

The quickstart does not prove firewall policy, external Caddy Admin API exposure, real provider token scope, or rollback behavior. Run real system validation before using an edge host for other people.