What Tailscale Is
Tailscale connects your devices into one private network, called a tailnet. Each device gets a private address, and devices talk to each other directly over WireGuard tunnels. A coordination service run by the vendor hands out keys and tells devices how to find each other; your traffic does not pass through it. When two devices cannot reach each other directly, traffic goes through the vendor's relay servers, still encrypted end to end.
If you do not want to depend on the vendor's coordination service, Headscale is an open-source, self-hosted control server that the Tailscale client can use instead.
Install Tailscale
The vendor publishes package repositories for Debian, Ubuntu, AlmaLinux, Rocky Linux, and other distributions, plus an install script that detects the distribution and adds the right repository. Download the script, read it, then run it:
curl -fsSL https://tailscale.com/install.sh -o tailscale-install.sh
less tailscale-install.sh
sudo sh tailscale-install.shYou can also add the repository by hand from the vendor's download page and then run sudo apt install tailscale or sudo dnf install tailscale. Make sure the background service runs and starts at boot:
sudo systemctl enable --now tailscaledJoin the Server to Your Tailnet
sudo tailscale upThe command prints a login link. Open it in a browser on your own computer, sign in, and approve the server. For servers set up by a script, you can create an auth key in the admin console and pass it with --auth-key. Treat that key like a password: keep it out of shell history and out of Git.
Check the Connection
| Command | What it shows |
|---|---|
tailscale status | Devices in the tailnet and their addresses |
tailscale ip -4 | This server's tailnet IPv4 address |
tailscale ping web1 | Whether a path is direct or relayed |
tailscale netcheck | NAT type and nearest relay |
Tailnet IPv4 addresses come from the 100.64.0.0/10 range, so they do not clash with the usual private ranges. With MagicDNS turned on in the admin console, devices are also reachable by their machine names.
Move SSH onto the Tailnet
This is the step that can lock you out, so follow the order:
- Keep your current SSH session open. Check that you can open the server console in your provider's control panel: it is your second way in if the tailnet ever fails.
- With Tailscale running on your own computer too, open a second terminal and connect with
ssh user@your_, using the address thatserver_ ip tailscale ip -4printed. - Allow SSH on the Tailscale interface. With UFW:
sudo ufw allow in on tailscale0 to any port 22 proto tcp. With firewalld, puttailscale0into a zone that allows the ssh service. - Test again in a new session over the tailnet.
- Only then remove the public rule, for example
sudo ufw delete allow OpenSSHorsudo ufw delete allow 22/tcp, whichever you added.
The rules are explained in how to set up the UFW firewall and firewalld basics.
Ports and the Firewall
Tailscale makes outbound connections and works through NAT, so in most setups no inbound port has to be opened for it. If outbound traffic is filtered, it needs TCP 443, UDP to port 3478, and UDP from port 41641. Admin interfaces you reach over the tailnet should listen on the tailnet address or on localhost, never on a public port.
Exit Nodes and Subnet Routers
- Exit node: other devices send all their internet traffic through the server. Advertise it with
sudo tailscale set --advertise-exit-nodeand approve it in the admin console. - Subnet router: tailnet devices reach a private network behind the server. Advertise it with
sudo tailscale set --advertise-routes=10.0.0.0/24and approve the route in the admin console. - Forwarding: on Linux both roles need IP forwarding switched on with sysctl first, as the vendor's subnet router documentation shows.
Key Expiry on Servers
Device keys expire after a period set for the tailnet (180 days by default for new tailnets), and the device must then sign in again. For a server that should stay connected, open the Machines page in the admin console, choose Disable Key Expiry in that machine's menu, and remove machines you retire.
Tailscale or Plain WireGuard?
| Tailscale | WireGuard | |
|---|---|---|
| Keys | Handled for you | You exchange them |
| Behind NAT | Works without open ports | Needs one open UDP port |
| Control | Vendor service or Headscale | Only your servers |
For a VPN that depends on nothing outside your own servers, see how to set up a WireGuard VPN server.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations