GuidesSecurity

What is Headscale? The self-hosted Tailscale control server

Headscale replaces Tailscale's control server with your own. What it supports (MagicDNS, ACLs, SSH, no Funnel), how to run it and join machines.

November 22, 2026The Everpod team
The short answer

Headscale is an open-source, self-hosted replacement for Tailscale’s control server, the service that tells your devices about each other’s keys and addresses. You keep using the ordinary Tailscale apps and point them at your own server with tailscale up --login-server https://your-headscale. It runs one tailnet, and as of v0.29.7 (October 30, 2026) it supports MagicDNS, ACLs and grants, tags, Tailscale SSH, Serve, exit nodes, subnet routers, OIDC sign-in and an optional built-in DERP relay, but not Funnel, network flow logs or OIDC groups in ACLs. You need a server with a public address, a domain and HTTPS on port 443. What it changes is who holds the power to add machines to your network: you, rather than Tailscale.

What Headscale replaces, and what it does not

A Tailscale network has two halves. The clients on each device make the encrypted WireGuard connections and carry your traffic, mostly straight from device to device. The control server never carries that traffic; in Headscale’s README, it “works as an exchange point of Wireguard public keys for the nodes in the Tailscale network”, and it also hands out addresses, DNS settings and the access policy. Tailscale’s clients are open source on most platforms; its control server is not. Headscale is a reimplementation of that one piece.

Everything else stays Tailscale’s. Your devices run the same Tailscale apps, and the relays they fall back on when no direct path exists (DERP) are still Tailscale’s public ones by default: Headscale’s example config loads https://controlplane.tailscale.com/derpmap/default. It has a built-in DERP server, off by default, which its DERP page describes as having “no speed or throughput optimisations”, and warns that using it alone makes it “a single point of failure”.

The project says it “is not associated with Tailscale Inc.”, though one of its active maintainers is employed by Tailscale and may work on it during work hours. Tailscale’s own position, from its 2022 post on open source, is that it will “continue to support Headscale as a complementary project”, and its CLI reference names it: for --login-server, “If you are using Headscale for your coordination server, use your Headscale instance’s URL.” Headscale is BSD-licensed.

What it supports compared with Tailscale

From Headscale’s feature page and policy reference, as of v0.29.7:

Client support follows Tailscale’s releases: Headscale aims to work with the last ten Tailscale client releases, and v0.29.7 needs at least Tailscale 1.80.0. Linux, the BSDs, Windows, macOS, iOS, tvOS and Android are all listed.

What you need to run it

Headscale’s requirements are a Linux or BSD server with a public IP address, ideally both IPv4 and IPv6, and a domain name for it. Clients reach it over HTTPS on TCP 443; other ports are possible but some Tailscale clients assume 443. TCP 80 is needed only if Headscale’s built-in Let’s Encrypt client gets the certificate, UDP 3478 only if you turn on the built-in DERP server, and the metrics port, TCP 9090, should stay private. The database is SQLite; the example config calls Postgres “highly discouraged”. Container images exist, but the FAQ says Docker deployments are not officially supported; the packages are.

On Debian or Ubuntu, the official route is the release’s package:

HEADSCALE_VERSION=0.29.7
HEADSCALE_ARCH=amd64
wget --output-document=headscale.deb \
  "https://github.com/juanfont/headscale/releases/download/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux_${HEADSCALE_ARCH}.deb"
sudo apt install ./headscale.deb
Copied

Then edit /etc/headscale/config.yaml and restart with sudo systemctl restart headscale. Three settings decide whether anything works:

Set a policy before you add a server. With policy.path empty, as it ships, “Headscale allows all traffic between nodes”, the same allow-all start as a new Tailscale tailnet. Point policy.path at a HuJSON policy file and run sudo systemctl reload headscale after every change, since Headscale picks up a changed policy file only on a reload.

Joining a machine to Headscale

Install the normal Tailscale client on the machine, then, from Headscale’s registration page:

# on the Headscale server, once
headscale users create <USER>

# on the machine joining
sudo tailscale up --login-server https://headscale.example.com
Copied

The client gives you a link to open in a browser. The page there shows an auth ID, which an administrator approves on the Headscale server:

headscale auth register --user <USER> --auth-id <AUTH_ID>
Copied

headscale nodes list then shows the machine online. With OIDC configured, the link signs you in through your identity provider instead. For a server that should join without anyone at a browser, create a pre-authenticated key with headscale preauthkeys create and pass it to tailscale up with --authkey; by default a key works once and expires after an hour. A key created with --tags tag:<TAG> joins the machine as a tagged device, which Headscale files under its special tagged-devices user rather than under a person.

On a phone: in the Android app, Settings, then Accounts, then the three-dot menu, then Use an alternate server. On iOS, the account icon, then Log in…, then the options menu, then Use custom coordination server. On a Mac, tailscale login --login-server <url>, or Option-click the menu bar icon and use Debug, then Custom Login Server.

Headscale for reaching an AI agent’s server

An agent’s server is one you want reachable from your own devices and from nowhere else, and Headscale does that job as Tailscale does. The lockdown in Tailscale SSH for an AI agent server carries over: grants from autogroup:member, a tag for the server, and a Tailscale SSH rule to that tag are all in Headscale’s policy support, so the server can be made unable to start connections to your laptop. Routing the server’s browsing through an exit node at home works too, and Serve can put a dashboard on the tailnet. Funnel cannot publish it.

What actually changes is where the trust sits.

Do not run Headscale on the agent’s server. The FAQ says running it on a machine that is also in the tailnet “can cause problems with subnet routers, traffic relay nodes, and MagicDNS” and is not supported, and an agent that reads untrusted text should not sit on the machine that can add devices to your network.

For one person with a laptop, a phone and an agent’s server, Tailscale’s free Personal plan, as of November 2026 up to six users with unlimited devices, does the same work with nothing to host. Headscale earns its keep when the control server must be one you run: a policy that no outside company holds the keys to your network, a network that has to keep working on terms you set, or an existing always-on public server where one more service costs little.

Run Claude Code, Codex, OpenCode, Pi, Hermes or OpenClaw on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.