Self-host Headscale with Levelrail
VerifiedSelf-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).
- Memory256 MiB
- Archarm64
- Services1
How to self-host Headscale
-
Pull the images
One image is pulled on your server.
Show images
headscale/headscale:v0.29.6
-
Create the app
One service starts in a single Compose app, with 1 named volume mount for your data, on port 8080.
-
Fill in the secrets
11 settings are preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
Headscale requirements
- Memory
- About 256 MiB
- Architectures
- amd64 image published, arm64 tested
- Ports
- 8080
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- not yet recorded
- Verified. Verified on arm64 with image tag v0.29.6. Our CI ran this exact image version and it answered on its health path. Evidence
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Headscale. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the Headscale docs page.
Deploy Headscale your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy Headscale from the CLI
levelrail-cli templates deploy headscale --name my-headscale Deploy Headscale with the API
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://levelrail.example.com/api/v1/service-templates/headscale/deploy Headscale configuration
Headscale services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| headscale | headscale/headscale:v0.29.6 | 8080 | data -> /var/lib/headscale |
Headscale environment variables
| Variable | Service | Value |
|---|---|---|
| HEADSCALE_DATABASE_SQLITE_PATH | headscale | Preset by the template |
| HEADSCALE_DATABASE_TYPE | headscale | Preset by the template |
| HEADSCALE_DERP_URLS | headscale | Preset by the template |
| HEADSCALE_DNS_BASE_DOMAIN | headscale | Preset by the template |
| HEADSCALE_DNS_OVERRIDE_LOCAL_DNS | headscale | Preset by the template |
| HEADSCALE_LISTEN_ADDR | headscale | Preset by the template |
| HEADSCALE_NOISE_PRIVATE_KEY_PATH | headscale | Preset by the template |
| HEADSCALE_PREFIXES_V4 | headscale | Preset by the template |
Show all 11 variables
- HEADSCALE_PREFIXES_V6headscalePreset by the template
- HEADSCALE_SERVER_URLheadscalePreset by the template
- HEADSCALE_UNIX_SOCKETheadscalePreset by the template
Ports and volumes
- Ports
- 8080
- Volumes
- 1 named mount: data -> /var/lib/headscale
Headscale FAQ
How much memory does Headscale need?
The catalog lists about 256 MiB of memory for Headscale.
Does Headscale run on arm64?
For Headscale, arm64 is tested; amd64 is image published.
Does Headscale need configuration before it starts?
No. The template fills in its own defaults.
Which ports does Headscale use?
Headscale listens on port 8080 inside the stack.
Where does Headscale keep its data?
In a named volume: data mounted at /var/lib/headscale.
Can I deploy Headscale on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Headscale, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image headscale/headscale:v0.29.6 is what you deploy there.