Headscale is an open-source, community-built reimplementation of Tailscale’s coordination server. The official clients connect to it unchanged, so you keep the Tailscale app on every device while the thing that decides who may talk to whom runs on your own box. That trade is a good one, but it comes with a specific set of operational problems nobody mentions in the quick-start.
What Headscale Is, and What It Is Not
It is a single Go binary that speaks the Tailscale control protocol. It is not affiliated with Tailscale Inc., it carries no support contract, and it deliberately targets a single tailnet — it is not a hosted multi-tenant product you can resell.
Install it from the release .deb and give it somewhere to live:
wget https://github.com/juanfont/headscale/releases/download/v0.26.1/headscale_0.26.1_linux_amd64.deb
sudo dpkg -i headscale_0.26.1_linux_amd64.deb
sudo systemctl enable --now headscale
headscale version
A Config That Works
Everything lives in /etc/headscale/config.yaml. The parts that matter:
server_url: https://headscale.example.com
listen_addr: 127.0.0.1:8080
metrics_listen_addr: 127.0.0.1:9090
noise:
private_key_path: /var/lib/headscale/noise_private.key
prefixes:
v4: 100.64.0.0/10
v6: fd7a:115c:a1e0::/48
database:
type: sqlite
sqlite:
path: /var/lib/headscale/db.sqlite
derp:
server:
enabled: true
region_id: 999
stun_listen_addr: "0.0.0.0:3478"
urls:
- https://controlplane.tailscale.com/derpmap/default
dns:
magic_dns: true
base_domain: tail.internal
nameservers:
global:
- 1.1.1.1
Two gotchas straight away. server_url must be HTTPS and must match the certificate exactly — put nginx or Caddy in front and terminate TLS there, because clients will refuse a mismatch with an error that does not say so clearly. And base_domain must not be a suffix of, or equal to, the hostname in server_url, or Headscale will not start.
Enable the embedded DERP server if any of your peers are behind carrier-grade NAT. Without a relay you own, those peers fall back to Tailscale’s public DERP servers, which rather defeats the point of running your own Tailscale control server.
Enrolling Nodes
headscale users create jonathan
headscale preauthkeys create --user jonathan --expiration 24h --reusable
# on the client
sudo tailscale up --login-server https://headscale.example.com \
--authkey <key> --accept-routes
Add --ephemeral for containers and CI runners so the node record disappears when the client stops. On iOS and Android you cannot pass --login-server, so you use the alternate-server field in the app’s settings, and on macOS you need the standalone build rather than the App Store one. That limitation catches people out constantly.
The Operational Gotchas
Key expiry will bite you
Node keys expire by default — 180 days, and the reminder emails Tailscale sends do not exist here. Six months after a clean install, servers silently drop off the network. For anything unattended:
headscale nodes list
headscale nodes expire --identifier 7 --disable # never expire this node
headscale nodes rename --identifier 7 --new-name build-runner
Pre-auth keys expire separately and default to one hour. Half of all “Headscale is broken” reports are an expired pre-auth key.
Upgrades track upstream, and upstream does not wait
Headscale chases a protocol it does not control. New Tailscale client releases occasionally land features Headscale has not implemented, and a client that auto-updates ahead of your server can stop connecting. Two rules: pin client versions on anything important, and read the release notes before upgrading Headscale — the config file has had breaking renames in most minor releases, and the ACL format moved to policy v2 with a database-backed mode. Back up the SQLite file first, every time:
sudo systemctl stop headscale
sudo sqlite3 /var/lib/headscale/db.sqlite ".backup '/var/backups/headscale-$(date +%F).sqlite'"
sudo systemctl start headscale
What simply does not work
- No admin console. There are third-party web UIs, all unofficial, all another thing to update.
- No Taildrop, no Funnel, no app connectors, no tailnet lock.
- Tailscale SSH support is partial and version-dependent.
- Exit nodes and subnet routes work, but need approving from the CLI:
headscale nodes approve-routes --identifier 7 --routes 192.168.10.0/24. - No support. When it breaks at 11pm, you have GitHub issues and Discord.
Would I Run It
For a homelab, a learning exercise, or anywhere a third-party coordination server is genuinely off the table — yes, and I have enjoyed it. It is well-built software and the maintainers are responsive. For anything you would be woken up for, no: the free Tailscale tier covers most personal tailnets, and what you are buying with the hosted control plane is not features, it is not having to think about key expiry and protocol drift.
If you do run it, do three things on day one. Disable expiry on every unattended node. Back up the database on a schedule, not on a whim. And keep one machine reachable by plain WireGuard on a Raspberry Pi as a way back in, because the day your control server will not start is the day you need to get to it.

Leave a Reply
You must be logged in to post a comment.