How to Install Tailscale on Linux (Zero-Config VPN for Your Homelab)
The official way to install Tailscale on Linux (Ubuntu, Debian, Fedora, Raspberry Pi OS and most mainstream distributions) is Tailscale’s install script, followed by tailscale up to sign the machine in:
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
That is the method in Tailscale’s own Linux install documentation. The script detects your distribution, adds Tailscale’s signed package repository, installs the tailscale package and starts the tailscaled service. If you would rather not pipe a script into a shell, the manual repository steps for Ubuntu and Debian are below, copied from the per-release instructions at pkgs.tailscale.com and checked against them on 31 October 2026. This guide then covers verifying the install, MagicDNS, subnet routing, exit nodes, Tailscale SSH, key expiry and what to do when it fails.
I have spent more hours than I care to admit configuring WireGuard tunnels by hand, generating key pairs, managing peer configs across devices, and debugging firewall rules when something stops working after a kernel update. Tailscale does the same job in about two minutes: install it, sign in, and your phone, your laptop and your servers are on the same private mesh network, routable from anywhere.
From the field: I run NetBird, an open-source WireGuard mesh I host myself, rather than Tailscale. Tailscale is the quickest way to the same result: no port forwarding, no dynamic DNS, install and connect. If you later want to own the control plane as well, NetBird and Headscale are the self-hosted routes.
Quick reference
| Task | Command |
|---|---|
| Install (any supported distro) | curl -fsSL https://tailscale.com/install.sh | sh |
| Join your tailnet | sudo tailscale up |
| Check peers and connection type | tailscale status |
| This machine’s Tailscale IP | tailscale ip -4 |
| Change a setting on a connected node | sudo tailscale set --<flag> |
| Advertise a subnet | sudo tailscale set --advertise-routes=192.168.1.0/24 |
| Offer an exit node | sudo tailscale set --advertise-exit-node |
| Use an exit node | sudo tailscale set --exit-node=<IP or name> |
| Enable Tailscale SSH | sudo tailscale set --ssh |
| Update the client | sudo tailscale update or sudo apt-get install tailscale |
| Network diagnostics | tailscale netcheck |
| Disconnect / sign out | sudo tailscale down / sudo tailscale logout |
What Tailscale actually is (and what it is not)
Tailscale is a mesh VPN built on top of WireGuard. Under the hood, every Tailscale connection is a WireGuard tunnel. But instead of you managing the key exchange, the peer discovery, the NAT traversal, and the routing tables yourself, Tailscale handles all of that through a coordination server.
Your traffic does not flow through that coordination server. It only handles authentication and key distribution. Data travels directly between your devices over WireGuard. If both devices are on the same LAN, traffic stays on the LAN. If they are across the internet, Tailscale punches through NAT and establishes a direct connection. Only when a direct path is impossible does traffic relay through Tailscale’s DERP servers, and even then it remains end-to-end encrypted.
What Tailscale gives you:
- Mesh networking: every device can reach every other device directly, not through a central gateway
- No port forwarding: no inbound firewall rules and no dynamic DNS
- MagicDNS: hostname resolution across your tailnet without running your own DNS
- Subnet routing: expose your LAN to your tailnet without installing Tailscale on every device
- Exit nodes: route all your internet traffic through a device you control
- Access controls: a policy file deciding who can reach what
- SSO: sign in with Google, Microsoft, GitHub or another identity provider
What Tailscale is not: fully self-hosted. Your devices authenticate against Tailscale’s coordination server. Your traffic is encrypted and peer-to-peer, but the control plane is theirs. If that bothers you, Headscale replaces the coordination server with one you run yourself (covered at the end). For most homelabbers, Tailscale’s free tier is the pragmatic choice.
Career Context: Mesh VPNs and zero-trust networking are reshaping enterprise infrastructure. Tailscale, Cloudflare Tunnel, and Zscaler are replacing traditional VPN concentrators in production environments. Understanding overlay networks, WireGuard, NAT traversal, and identity-based access control is directly relevant to Network Engineer, DevOps, and Platform Engineering roles. Running Tailscale on your homelab teaches you the concepts that enterprises are paying consultants to implement.
Prerequisites
- A supported Linux machine. The install script supports Ubuntu- and Debian-based distributions, RHEL, CentOS, Fedora and derivatives, Raspberry Pi OS, Amazon Linux, openSUSE/SLE, Oracle Linux and Photon OS. Arch and NixOS install from their own repositories.
- A Tailscale account. The free Personal plan currently allows up to 6 users, unlimited user devices and up to 50 tagged resources. Check the pricing page before you build on it, as plan limits have changed over time.
- A second device already on the tailnet (your laptop or phone) so you can test the connection.
- Outbound internet access on TCP 443 and UDP 3478, ideally with UDP 41641 allowed out for direct connections. No inbound ports are needed.
Pro tip: If your homelab sits behind CGNAT (common with mobile broadband and some fibre providers), Tailscale is your best friend. Port forwarding cannot work behind CGNAT. Tailscale only makes outbound connections and traverses the NAT from both sides, which is why it works on 4G connections where nothing else can establish an inbound tunnel.
Step 1: Install Tailscale
Option A: the official install script (all supported distros)
curl -fsSL https://tailscale.com/install.sh | sh
On Ubuntu and Debian the script reads /etc/os-release, downloads the release-specific signing key to /usr/share/keyrings/tailscale-archive-keyring.gpg, writes /etc/apt/sources.list.d/tailscale.list, installs tailscale and tailscale-archive-keyring, and runs systemctl enable --now tailscaled. On Fedora and RHEL-family systems it adds the Tailscale .repo file with dnf config-manager and does the same. Piping a script to a shell makes some people uneasy, and that is a reasonable instinct: you can download it, read it, then run it with sh install.sh, or use the manual steps below, which do the same thing.
Option B: manual install on Ubuntu or Debian (apt repository)
These are the official steps for Ubuntu 24.04 LTS (Noble):
# Add Tailscale's package signing key
sudo mkdir -p --mode=0755 /usr/share/keyrings
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
# Add the Tailscale repository
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
# Install Tailscale
sudo apt-get update && sudo apt-get install tailscale
# Connect
sudo tailscale up
The repository file you just downloaded contains a single line that ties the repo to that key:
deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu noble main
For other releases, swap the distribution and codename in both URLs:
| Release | Path to use in both URLs |
|---|---|
| Ubuntu 26.04 LTS (Resolute Raccoon) | ubuntu/resolute |
| Ubuntu 24.04 LTS (Noble Numbat) | ubuntu/noble |
| Ubuntu 22.04 LTS (Jammy Jellyfish) | ubuntu/jammy |
| Debian 13 (Trixie) | debian/trixie |
| Debian 12 (Bookworm) | debian/bookworm |
So on Debian 13 the two download lines become https://pkgs.tailscale.com/stable/debian/trixie.noarmor.gpg and https://pkgs.tailscale.com/stable/debian/trixie.tailscale-keyring.list. Not sure of your codename? Run . /etc/os-release; echo $VERSION_CODENAME. On Linux Mint and other Ubuntu derivatives, use the Ubuntu base instead: echo $UBUNTU_CODENAME (Mint 22.x reports noble). The install script does this lookup for you.
Older guides use apt-key add and a key ending in .gpg or .asc. That method is deprecated in current Debian and Ubuntu releases; the signed-by keyring above is what Tailscale publishes now.
Fedora, Arch and Raspberry Pi OS
# Fedora 41 and later (dnf5)
sudo dnf config-manager addrepo --from-repofile=https://pkgs.tailscale.com/stable/fedora/tailscale.repo
sudo dnf install tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up
# Arch Linux (official repositories)
sudo pacman -S tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up
Older Fedora releases with dnf 4 use sudo dnf config-manager --add-repo https://pkgs.tailscale.com/stable/fedora/tailscale.repo instead. Raspberry Pi OS is Debian-based: use the install script, or the Debian steps with your release codename.
Proxmox LXC containers
An unprivileged LXC container has no /dev/net/tun by default, so tailscaled cannot create its interface. Per Tailscale’s LXC guide, on Proxmox 7 or later add these two lines to /etc/pve/lxc/<CTID>.conf on the host, then stop and start the container:
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
The same guide gives an alternative: pct set <CTID> --dev0 /dev/net/tun, or add /dev/net/tun under the container’s Resources, Device Passthrough in the web UI. Then install Tailscale inside the container as normal.
Step 2: Connect to your tailnet
sudo tailscale up
On a machine that has not signed in yet, this prints a login link (example output; your link will differ):
To authenticate, visit:
https://login.tailscale.com/a/1a2b3c4d5e6f
Success.
Open the link on any device with a browser, sign in, and approve the machine. The command waits until you do, then prints Success.. On a headless server, that is the normal way to do it: copy the link from the SSH session into your laptop’s browser.
For servers you build with scripts or Ansible, generate an auth key in the admin console (Settings, Keys) and pass it instead, so no browser is needed:
sudo tailscale up --auth-key=tskey-auth-XXXXXXXXXXXX
Treat auth keys like passwords: keep them out of shell history and Git.
Step 3: Verify it worked
# Is the daemon running and enabled?
systemctl status tailscaled
# This machine's Tailscale IPv4 address (100.x.y.z)
tailscale ip -4
# Every peer in the tailnet and how you reach it
tailscale status
The tailscale status output looks like this (example output, taken from the format in Tailscale’s CLI reference):
100.101.102.103 homelab-01 you@ linux -
100.88.12.40 laptop you@ linux active; direct 203.0.113.7:41641, tx 1116 rx 1124
100.92.14.87 phone you@ iOS idle; tx 1214 rx 50
Columns are Tailscale IP, machine name, owner, OS and connection state. direct means a peer-to-peer WireGuard path; relay means traffic is going via a DERP server. Then test from the new machine to another device:
tailscale ping laptop # pings over Tailscale only, reports direct or via DERP
ping 100.88.12.40 # normal ping to a Tailscale IP
Finally, check the Machines page in the admin console: the new device should be listed and connected.
Step 4: MagicDNS
MagicDNS lets you reach devices by name instead of IP. Instead of remembering that your server is 100.101.102.103, you use homelab-01 or its full name, homelab-01.your-tailnet.ts.net.
MagicDNS is on by default for tailnets created since late 2022. Check it in the admin console under DNS and turn it on if it is off. Once enabled, every device on your tailnet can resolve every other device by name:
ssh user@homelab-01 # instead of ssh [email protected]
curl http://homelab-01:3001 # reach a service by hostname
Rename a machine in the admin console, or with sudo tailscale set --hostname=homelab-01, and its MagicDNS name follows.
Pro tip: If you run Pi-hole or AdGuard Home for DNS-level ad blocking, you can configure Tailscale to use your Pi-hole as the DNS server for your tailnet. Go to the DNS settings in the admin console and add your Pi-hole’s Tailscale IP as a custom nameserver. Now every device on your tailnet gets ad blocking, even when you are away from home.
Step 5: Subnet routing (expose your whole LAN)
Subnet routing lets one Tailscale node act as a gateway to your local network. Instead of installing Tailscale on your NAS, your printer and every IoT gadget, you install it on one Linux machine and advertise the LAN subnet. These steps follow Tailscale’s subnet router documentation.
On the machine that will act as the subnet router:
# Enable IP forwarding (required for subnet routers and exit nodes)
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
# Advertise your LAN subnet
sudo tailscale set --advertise-routes=192.168.1.0/24
Use tailscale set rather than tailscale up to change settings on a node that is already connected. tailscale up expects you to repeat every non-default flag each time and refuses otherwise (the exact error is in the troubleshooting section).
Replace 192.168.1.0/24 with your LAN. Separate several subnets with commas. If the host uses firewalld, Tailscale’s docs note you may also need sudo firewall-cmd --permanent --add-masquerade.
Then approve the route: in the admin console open Machines, find the device with the Subnets badge, open its route settings, tick the subnet and save. Routes stay inactive until approved, so a rogue device cannot quietly expose a network.
On the clients: Windows, macOS, iOS and Android accept advertised routes by default. Linux clients do not, so on any Linux machine that needs to reach the LAN, run:
sudo tailscale set --accept-routes
Now your phone on mobile data can reach your NAS at 192.168.1.100 without the NAS knowing Tailscale exists.
Be thoughtful about what you expose. Subnet routing makes your entire LAN reachable from any tailnet device. If you share your tailnet with friends or family, they can reach those devices too unless you restrict it in the access control policy. For a personal tailnet this is fine. If others have access, limit who can reach which subnets.
Step 6: Exit nodes (route all traffic through your server)
An exit node routes all of a device’s internet traffic through another device on your tailnet: useful on public Wi-Fi, or to appear to be at home while abroad. The exit node needs IP forwarding enabled, exactly as in Step 5. Then, on the machine that will be the exit node:
sudo tailscale set --advertise-exit-node
Approve it in the admin console: Machines, the device’s menu, Edit route settings, Use as exit node.
On a Linux client, per the exit node documentation:
# Send all traffic via the exit node (Tailscale IP or machine name)
sudo tailscale set --exit-node=homelab-01
# Same, but keep direct access to your local network
sudo tailscale set --exit-node=homelab-01 --exit-node-allow-lan-access=true
# Stop using the exit node
sudo tailscale set --exit-node=
On the mobile apps and desktop clients, exit node selection is a menu in the app.
Step 7: Tailscale SSH (optional)
Tailscale can handle SSH logins itself, authenticating by your tailnet identity instead of SSH keys:
sudo tailscale set --ssh
According to the Tailscale SSH documentation, this intercepts port 22 only for connections arriving over Tailscale; your OpenSSH server, sshd_config and authorized_keys are left alone, so normal SSH on the LAN keeps working. Access is governed by the ssh rules in your tailnet policy. An unmodified tailnet has a default rule that lets you reach your own devices in check mode, which asks you to re-authenticate in the browser periodically. If you prefer plain OpenSSH, skip this step and SSH to the machine’s MagicDNS name as normal.
Step 8: Key expiry on servers
Each device’s node key expires after 180 days by default, after which connections to and from it stop until someone signs it in again. For a server you rarely touch, that is an outage waiting to happen. In the admin console, open the server’s menu on the Machines page and choose Disable key expiry. If a key has already expired, re-authenticate with:
sudo tailscale up --force-reauth
Don’t run that over an SSH session that itself goes via Tailscale unless you have another way in: it drops the Tailscale connection while it re-authenticates (key expiry docs).
Keeping Tailscale updated
# Ubuntu/Debian: it is a normal apt package
sudo apt-get update && sudo apt-get install tailscale
# Or let the client update itself
sudo tailscale update
# Or turn on automatic updates
sudo tailscale set --auto-update
Auto-updates are not supported on Arch-based distributions, where pacman does the job.
Tailscale vs raw WireGuard: convenience vs control
Tailscale wins when:
- You need to connect devices quickly without fiddling with configs
- You are behind CGNAT or complex NAT where port forwarding is impossible
- You want to share access with family members without teaching them VPN configuration
- You need mesh networking (every device talks to every device) rather than hub-and-spoke
- You want MagicDNS and key distribution handled for you
Raw WireGuard wins when:
- You want zero dependency on any third-party service, not even a coordination server
- You are connecting infrastructure where installing Tailscale is not practical (embedded devices, network equipment)
- You are running a site-to-site VPN between fixed locations with static IPs
- You want to understand what is happening at every layer
For most homelabbers, Tailscale is the right starting point. You can always add raw WireGuard tunnels for specific use cases later. For the record, I do not use Tailscale myself: my estate runs a self-hosted NetBird mesh (also WireGuard underneath) for daily device access, plus a plain WireGuard exit node on a VPS. Same concepts, self-hosted control plane.
The self-hosting honesty: Headscale
Headscale is an open-source, self-hosted implementation of the Tailscale coordination server. You run it on your own infrastructure, and the standard Tailscale clients connect to your server instead of Tailscale’s.
It gives you full control of the control plane: no Tailscale account, your own authentication and access rules. The trade-off is that you set it up and maintain it, and you lose the polished admin console and some features.
My honest advice: start with Tailscale. Learn the concepts, get comfortable with mesh networking, subnet routing, and access controls. If you outgrow the free tier or the third-party dependency genuinely bothers you, move to Headscale. The client is the same, so the concepts carry straight over.
Troubleshooting
“Failed to connect to local Tailscale daemon” / “tailscaled.service not running”
The CLI can’t reach tailscaled. Start and enable it, then read its log if it won’t stay up:
sudo systemctl enable --now tailscaled
sudo journalctl -u tailscaled -n 50
In an LXC container, a log complaining about /dev/net/tun means the TUN device isn’t passed through (see the Proxmox section above). If it fails to load on a VM or bare metal, sudo modprobe tun.
tailscale status says “Logged out.” or “Machine is not yet approved by tailnet admin.”
“Logged out.” means the machine has never signed in, or has signed out: run sudo tailscale up and open the link. “Not yet approved” means your tailnet has device approval turned on: approve the machine on the admin console’s Machines page.
tailscale up hangs
Usually it is waiting for you to open the login link it printed further up the terminal; scroll back and open it in a browser. If no link appears at all, the machine can’t reach the coordination server: check outbound TCP 443 isn’t blocked, and that DNS works (curl -I https://login.tailscale.com). Tailscale’s firewall ports page lists what needs to be allowed out: TCP 443, UDP 3478 and, for direct connections, UDP 41641.
“Error: changing settings via ‘tailscale up’ requires mentioning all non-default flags”
You ran tailscale up with one new flag on a node that already has other non-default settings. Tailscale refuses rather than silently resetting the others. Use sudo tailscale set --the-flag instead, which changes only what you name. The error message also prints a full tailscale up command with your current settings that you can copy and edit.
“IP forwarding is disabled, subnet routing/exit nodes will not work”
The warning is literal. Apply the sysctl lines from Step 5 and check with sysctl net.ipv4.ip_forward, which should print net.ipv4.ip_forward = 1.
Subnet routes not working
- Not approved. Approve the route on the Machines page.
- Linux client not accepting routes. Run
sudo tailscale set --accept-routeson the client. - Forwarding off on the router node. See the previous section.
- Firewall dropping forwarded traffic. On Ubuntu with ufw:
sudo ufw route allow in on tailscale0. With firewalld, add masquerade as in Step 5. - Return path broken. A Linux subnet router masquerades tailnet traffic by default, so LAN devices reply to the router and everything works. If you turned that off with
--snat-subnet-routes=false, LAN devices send replies for100.xaddresses to your home router, which drops them. Either turn SNAT back on withsudo tailscale set --snat-subnet-routes=true, or add a static route for100.64.0.0/10pointing at the subnet router’s LAN IP.
MagicDNS names don’t resolve on Linux
Tailscale works with systemd-resolved (Ubuntu’s default) where it can; problems tend to come from something else rewriting /etc/resolv.conf. Tailscale’s Linux DNS page gives this fix for NetworkManager systems where /etc/resolv.conf isn’t the systemd-resolved stub:
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved
sudo systemctl restart NetworkManager
sudo systemctl restart tailscaled
Also check this machine is accepting tailnet DNS settings: sudo tailscale set --accept-dns=true.
Slower than expected
Check whether traffic is going direct or via a DERP relay. tailscale status shows direct or relay per peer, tailscale ping <peer> tells you which path each ping took, and tailscale netcheck reports whether UDP works and what kind of NAT you are behind. Relayed traffic is still encrypted and works, just with more latency. It is common on symmetric NAT (some corporate networks and mobile carriers); allowing UDP 41641 outbound often fixes it.
Tailscale interferes with Docker networking
This bites when a node accepts subnet routes that overlap Docker’s bridge ranges. Linux nodes don’t accept routes unless you told them to. If containers lose connectivity after you enabled --accept-routes on the Docker host, either run sudo tailscale set --accept-routes=false there or change the overlapping Docker or LAN range.
What to set up next
Tailscale solves the “access your homelab from anywhere” problem. Now that you have reliable remote connectivity, here is what to build on top of it:
- Build Your First Homelab: if you set up Tailscale to access a single machine, this guide helps you expand it into a proper platform
- Uptime Kuma Monitoring: now that you can reach your homelab remotely, monitor it so you know when something breaks before you try to connect
- Self-Hosted Password Manager with Vaultwarden: Tailscale makes Vaultwarden accessible from anywhere without exposing it to the public internet, which is the ideal deployment
- Install Docker on Ubuntu 24.04: the foundation for most self-hosted services you will run behind your Tailscale network
- DuckDNS Dynamic DNS: if you need public-facing services alongside your Tailscale mesh, DuckDNS handles the dynamic IP problem
- Jellyfin Media Server: stream your own media library anywhere. Tailscale gives you private access without opening ports to the internet
Once every device is two minutes away from joining the mesh, you stop worrying about firewalls, port forwarding and dynamic DNS for internal access. It doesn’t replace understanding networking fundamentals, but it removes a lot of friction from getting things done.
Watch Out For This
Tailscale’s free plan limits have changed several times (users, and how devices tagged as servers are counted). Check the current limits on the pricing page before committing your whole infrastructure, and keep the control-plane dependency in mind.
Key Takeaways
- The official Linux install is
curl -fsSL https://tailscale.com/install.sh | shthensudo tailscale up. On Ubuntu and Debian the manual alternative is a keyring plus asigned-byapt repository from pkgs.tailscale.com, using your release codename. - Verify with
tailscale status,tailscale ip -4and the Machines page in the admin console. - Use
tailscale setto change settings on a connected node;tailscale upwants every non-default flag repeated. - Subnet routers and exit nodes need IP forwarding and admin approval, and Linux clients need
--accept-routesto use subnet routes. - Disable key expiry on servers, or they drop off the tailnet after 180 days.
- Tailscale is not fully self-hosted. If that matters to you, Headscale is the open-source self-hosted alternative.
Related Guides
If you found this useful, these guides continue the journey:
- How to Set Up WireGuard VPN on Ubuntu 24.04: the manual approach for full control over your VPN tunnels
- What Is Zero Trust Network Access (ZTNA)?: understand how zero trust compares to mesh VPNs
- How to Build Your First Homelab in 2026: the full picture for building your lab environment
- How to Install Nginx Proxy Manager with Docker: reverse proxy for services accessible via Tailscale
- SSH Essentials: Remote Administration: secure shell access complements VPN connectivity
Before you expose any of this: the seven steps that decide whether a home lab survives contact with the internet, in the order they matter, are in How to Secure a Homelab Network in 2026.
RTFM Apparel · printed in the UK

ReadTheManual is run, written and curated by Eric Lonsdale.
Eric has over 20 years of professional experience in IT infrastructure, cloud architecture, and cybersecurity, but started with PCs long before that.
He built his first machine from parts bought off tables at the local college campus, hoping they worked. He learned on BBC Micros and Atari units in the early 90s, and has built almost every PC he’s used between 1995 and now.
From helpdesk to infrastructure architect, Eric has worked across enterprise datacentres, Azure environments, and security operations. He’s managed teams, trained engineers, and spent two decades solving the problems this site teaches you to solve.
ReadTheManual exists because Eric believes the best way to learn IT is to build things, break things, and actually read the manual. Every guide on this site runs on infrastructure he owns and maintains.
Enjoyed this guide?
New articles on Linux, homelab, cloud, and automation every 2 days. No spam, unsubscribe anytime.







