Self-host Headscale on a VPS
Self-hosted Tailscale control server, configured entirely through environment variables. Embedded DERP and STUN are off (the platform has no UDP), so clients relay through the public Tailscale DERP map over HTTPS. Create users and pre-auth keys with the CLI in the container (headscale users create, headscale preauthkeys create).
levelrail-cli templates deploy headscale --name my-headscaleSpecification
- Status
- Verified on arm64 with image tag v0.29.6
- Category
- Infrastructure
- Services
- headscale
- Ports
- 8080
- Volumes
- 1
- Memory
- about 256 MiB
- arm64
- tested
- amd64
- image published
- Settings to fill in
- none
- License
- not yet recorded
About Headscale
Self-hosted Tailscale control server, configured entirely through environment variables. Embedded DERP and STUN are off (the platform has no UDP), so clients relay through the public Tailscale DERP map over HTTPS. Create users and pre-auth keys with the CLI in the container (headscale users create, headscale preauthkeys create).
What it deploys
Headscale runs as one service in a single Compose app, listening on port 8080, with 1 named volume mount.
| Service | Image | Tag | Ports | Volumes |
|---|---|---|---|---|
| headscale | headscale/headscale | v0.29.6 | 8080 | data -> /var/lib/headscale |
Before you install
- CPU architecture. arm64 listed. Every image lists linux/arm64 in its registry manifest. That is a manifest fact, not proof the app runs on Arm.
- Verified. Verified on arm64 with image tag v0.29.6. Verified means our CI ran this exact image version and it answered on its health path. Evidence
Settings and environment
You do not have to fill in anything. Values are never shown here.
| Service | Variable | Value |
|---|---|---|
| headscale | HEADSCALE_DATABASE_SQLITE_PATH | Preset by the template |
| headscale | HEADSCALE_DATABASE_TYPE | Preset by the template |
| headscale | HEADSCALE_DERP_URLS | Preset by the template |
| headscale | HEADSCALE_DNS_BASE_DOMAIN | Preset by the template |
| headscale | HEADSCALE_DNS_OVERRIDE_LOCAL_DNS | Preset by the template |
| headscale | HEADSCALE_LISTEN_ADDR | Preset by the template |
| headscale | HEADSCALE_NOISE_PRIVATE_KEY_PATH | Preset by the template |
| headscale | HEADSCALE_PREFIXES_V4 | Preset by the template |
| headscale | HEADSCALE_PREFIXES_V6 | Preset by the template |
| headscale | HEADSCALE_SERVER_URL | Preset by the template |
| headscale | HEADSCALE_UNIX_SOCKET | Preset by the template |
Install Headscale on a VPS
-
Install Levelrail on a fresh VPS
Run this as root on a Linux server (amd64 or arm64) with ports 80 and 443 reachable. The installer prints a setup link.
curl -fsSL https://levelrail.com/install.sh | sudo sh -
Sign in
Open the setup link, choose a password, then log the CLI in. The CLI install command is
curl -fsSL https://levelrail.com/install-cli.sh | shif the machine does not have it. See Getting started.levelrail-cli login --device -
Read the template
Shows the entry, including its full compose.yaml.
levelrail-cli templates get headscale -
Deploy it
This deploys the template compose file as an app. The app name defaults to the template id; --name sets another.
levelrail-cli templates deploy headscale --name my-headscale
Without a domain the app gets an sslip.io address. You can also deploy it from the dashboard: Apps, New app, Browse templates, then Headscale.
Docs and upstream
More in Infrastructure
- HAProxyHigh-performance TCP and HTTP load balancer on the official image. The install form carries haproxy.cfg as an editable file, so it starts with a working config instead of exiting on a missing one.
- imgproxyA fast image processing server that resizes, crops and converts images on the fly from signed URLs. Apache-2.0 licensed. A signing key and salt are generated for you, so only URLs signed with them are served.
- Kong GatewayAn API gateway in database-less mode on the open source image. Load routes with the admin API at kong:8001 from inside this project. With no routes the proxy answers 404, which is the healthy state.
- KrakenDStateless high performance API gateway on the official image. The install form carries krakend.json as an editable file, so it starts with a working route table instead of exiting on a missing config.
- etcdA distributed key-value store for configuration and coordination, running as a single member.
- Envoy ProxyCloud native edge and service proxy on the official image. The install form carries envoy.yaml as an editable file, so it starts with a working listener instead of exiting on a missing config.