brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tailscale login with a login server connects the client to Headscale

Network and access
~/tips/tip-tailscale-login-server-headscale

sudo tailscale login --login-server=https://headscale.example.com

Point the regular Tailscale client at your own coordination server instead of Tailscale's.

Headscale is an open source coordination server that speaks the Tailscale protocol. You keep using the normal Tailscale client; you only tell it where to log in.

sudo tailscale login --login-server=https://headscale.example.com

The same flag works with tailscale up. Without it, the client uses Tailscale’s own server at controlplane.tailscale.com. The login link it prints goes to your Headscale instance, and Headscale’s docs explain how you approve the device there, or how to make a pre-auth key so you can pass --auth-key and skip that step.

Each client stores which server it belongs to, so after the first login a plain tailscale up keeps using Headscale.

Going back is the part people get stuck on. Tailscale’s docs say to start with tailscale logout. If that does not reset the client, stop tailscaled and remove its state file (/var/lib/tailscale/tailscaled.state on Linux), then start it again. That wipes the device’s local Tailscale state, so treat it as the last resort.

Headscale does not do everything the hosted service does, so I’d check its docs for a feature before planning around it. Things like Funnel depend on Tailscale’s own infrastructure.

Further reading: Use a custom control server, Headscale

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link