A traditional VPN means a central server, port forwarding, firewall rules, and a config file you will break at 2 AM. Tailscale throws all of that away. It builds a private mesh network between your devices using WireGuard, so every server, laptop, and phone gets a stable private IP and can talk directly to the others — no open ports, no public IP needed, no certificate juggling. In this guide you will install Tailscale on Ubuntu 24.04, connect your first machines, and then turn one of them into an exit node and a subnet router so you can reach your whole home network from anywhere.

Prerequisites

  • An Ubuntu 24.04 (or 22.04) server or desktop with sudo access.
  • A Tailscale account — free for personal use, up to 100 devices and 3 users. Sign up at tailscale.com with Google, GitHub, Microsoft, or email.
  • A second device (laptop, phone, or another server) to test the mesh — optional but recommended.
  • Outbound internet access from the server. No inbound ports need to be open.

Step 1: Install Tailscale on Ubuntu

The fastest way is Tailscale's official install script. It detects your Ubuntu version, adds the correct repository, and installs the package:

curl -fsSL https://tailscale.com/install.sh | sh

The script downloads the installer from Tailscale's own domain and runs it with your current privileges. If you would rather see exactly what is being added to your system, install from the APT repository by hand instead. These commands are for Ubuntu 24.04 (Noble); on Ubuntu 22.04 replace noble with jammy:

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
sudo apt-get update
sudo apt-get install -y tailscale

The first command downloads Tailscale's package signing key so APT can verify the packages. The second adds the repository list. After the update, APT installs the tailscale package, which also sets up the tailscaled background service. Confirm the install with:

tailscale version

You should see a version number like 1.8x.x. If the command is not found, log out and back in so your shell picks up the new PATH, or use the full path /usr/bin/tailscale.

Step 2: Connect your first machine to your tailnet

Your private network in Tailscale is called a tailnet. Joining it is one command:

sudo tailscale up

The command prints a login URL. Open it in a browser, sign in with the account you created, and the machine joins your tailnet. The terminal then shows the machine's new Tailscale IP, which always starts with 100. — for example 100.64.0.5. This address is stable: it follows the machine wherever it goes, even if its public IP or Wi-Fi network changes. The up command needs sudo because it configures the WireGuard interface and routing on the system.

Step 3: Verify the mesh is working

Check the status of your tailnet from the server:

tailscale status

This lists every device in your tailnet, its Tailscale IP, hostname, operating system, and whether it is online. Now test real traffic between two machines. From your Ubuntu server, ping another device by its Tailscale IP:

tailscale ping 100.64.0.12

Replace the address with the real IP of your other device. A healthy result looks like pong from ... via 192.168.1.10:41641 — the via part shows a direct peer-to-peer connection. If it says via DERP instead, traffic is flowing through one of Tailscale's relay servers. That still works, but it is slower; it usually means a firewall or NAT is blocking direct UDP, which we fix in Step 8. You can also see your own address with:

tailscale ip -4

Step 4: Reach machines by name with MagicDNS

MagicDNS is on by default, and it means you never have to remember those 100.x addresses. Every device gets a DNS name like webserver.tailabcd.ts.net, where tailabcd is your tailnet name. Try it:

ping webserver.tailabcd.ts.net

Use the real hostname shown in tailscale status. If name resolution fails, check that MagicDNS is enabled in the Tailscale admin console under DNS, and that your system is using Tailscale's resolver — Tailscale manages this automatically on Ubuntu through systemd-resolved. From now on, SSH to your servers with ssh user@webserver from any device on the tailnet, from any network in the world.

Step 5: Route all traffic through an exit node (optional)

An exit node is a machine on your tailnet that forwards internet traffic for other devices — handy when you are on public Wi-Fi and want your traffic to come out of your home or office IP. Pick a machine that is always on, for example a home Ubuntu server, and enable IP forwarding on it:

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

These commands write the forwarding settings to a config file and apply them immediately. Without IP forwarding, the kernel drops packets that are meant for another network. Now advertise the machine as an exit node:

sudo tailscale up --advertise-exit-node

One approval is still needed: open the Tailscale admin console, go to Machines, click the three dots next to your server, choose Edit route settings, and enable "Use as exit node". Then, on any other device, route its traffic through it:

sudo tailscale up --exit-node=100.64.0.5

Use the exit node's Tailscale IP or its hostname. Check your public IP afterwards — it should now be the exit node's IP. To stop using the exit node, run sudo tailscale up --exit-node= with an empty value.

Step 6: Access your home LAN with subnet routes (optional)

Subnet routes let you reach devices that do not run Tailscale at all — a printer, a NAS, a router admin page. On the machine that sits on the same LAN as those devices, advertise the subnet (adjust 192.168.1.0/24 to your real LAN range):

sudo tailscale up --advertise-routes=192.168.1.0/24

IP forwarding must be enabled for this to work, exactly as in Step 5. Then approve the route in the admin console: Machines, the three dots next to your router machine, Edit route settings, and approve the subnet. Finally, on the device you are connecting from, accept the routes:

sudo tailscale up --accept-routes

Now you can open http://192.168.1.1 or ping your NAS from a hotel Wi-Fi as if you were sitting at home. Only advertise subnets you own and trust, and remember that anyone on your tailnet who accepts routes can reach that LAN.

Step 7: Try Tailscale SSH (optional)

Tailscale SSH replaces port 22 exposure entirely. It authenticates SSH logins against your Tailscale identity instead of passwords or keys, and it logs every session. Enable it on a server with:

sudo tailscale up --ssh

Then connect from another tailnet device with tailscale ssh user@webserver. The first time, Tailscale checks the access rules in the admin console — by default, the tailnet owner can SSH anywhere, and other users need to be granted access under the SSH section of the access controls. If you enable Tailscale SSH, you can safely close port 22 on your firewall altogether, because SSH no longer listens on the public interface for authentication.

Step 8: Make it survive reboots and firewalls

Tailscale installs itself as a systemd service, so it starts automatically on boot. Confirm it is enabled:

sudo systemctl status tailscaled

You should see active (running) and enabled. If a machine ever shows as offline after a reboot, restart the service with sudo systemctl restart tailscaled and run sudo tailscale up again. For the best connection quality, allow Tailscale's direct-connection port through UFW. It is not required — Tailscale falls back to relays without it — but direct connections are faster:

sudo ufw allow 41641/udp
sudo ufw reload

That is the only firewall rule Tailscale ever needs. No port forwarding on your router, no inbound rules from the internet, and no exposed SSH port if you use Tailscale SSH.

Verify it worked

  • tailscale status shows all your devices as online.
  • tailscale ping <other-device-ip> returns a pong, ideally via a direct connection rather than DERP.
  • ping <hostname>.tailabcd.ts.net resolves and replies — MagicDNS is working.
  • With an exit node active, an IP-check site shows the exit node's public IP.
  • With a subnet route approved and accepted, you can open a LAN-only address such as your router page from outside the LAN.

Common issues and fixes

1. "tailscale up" hangs or never prints a login URL

The background service is probably not running. Check it with sudo systemctl status tailscaled and restart it with sudo systemctl restart tailscaled, then run sudo tailscale up again. Also check that the machine has outbound internet access — Tailscale needs to reach its control server to register.

2. Devices show as offline in "tailscale status"

First check the other device is actually powered on and its Tailscale service is running. Then check the key expiry: by default, device keys expire after 180 days and the device drops off the tailnet. In the admin console you can disable key expiry per machine, which is what you want for servers. Re-authenticate an expired device with sudo tailscale up.

3. Traffic goes via DERP relay instead of direct

This is a NAT or firewall issue, not a Tailscale bug. Make sure UDP port 41641 is allowed outbound — most home routers allow this already, but strict corporate firewalls block it. As a quick test, run tailscale ping and look at the via line; if both devices are on the same LAN and still relay, check that no local firewall is blocking UDP.

4. Exit node does not appear in the list

Advertising the exit node is only half the job — it must be approved in the admin console under Machines, Edit route settings. Also confirm IP forwarding is actually on: sysctl net.ipv4.ip_forward must print 1. If it prints 0, the sysctl config file was not applied; re-run sudo sysctl -p /etc/sysctl.d/99-tailscale.conf.

5. Subnet route is approved but LAN devices do not respond

Check three things in order: IP forwarding is enabled on the router machine, the route is approved in the admin console, and the connecting device ran sudo tailscale up --accept-routes. A common gotcha is advertising the wrong subnet — run ip route on the router machine and advertise the exact CIDR of its LAN interface.

Conclusion

In about ten minutes you have a private network that follows your devices anywhere: stable 100.x addresses, hostnames that just work, an exit node for safe browsing on public Wi-Fi, and subnet routes into your home LAN — all without opening a single port. The next step is to add your phone and laptop to the same tailnet, then disable key expiry on your servers so they never silently drop off. If you need help wiring Tailscale into a production setup — exit nodes on your VPS, subnet routes into an office network, or locking it down with ACLs — the XpertBees team sets up and manages secure server infrastructure for businesses every day.