Let’s say you have a headscale server, and now you’d like to connect your Linux machines to your self-hosted tailnet.
The first thing we gotta do, is installing tailscale;
curl -fsSL https://tailscale.com/install.sh | sh
Or if we wanna do it manually, in the case of Ubuntu 24.04, we first get the repo key and repo:
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
Then we install tailscale itself:
sudo apt update
sudo apt install tailscale
Usually this is where we’d run sudo tailscale up
and get a log-in url… however, in the case of headscale we’re gonna do things slightly differently…
We sign in to our server which is running headscale…
Assuming you already created your user account with:
headscale ns c <USER>
We then create a preauth key with:
headscale pre c -u <USER>
Now, back on our Linux machine which we want to connect to our tailnet we set up Tailscale with:
tailscale up --login-server <YOUR_HEADSCALE_URL> --authkey <YOUR_AUTH_KEY>
That’s all there is to it! Now keep repeating the step for all your Linux devices!
Leave A Comment