Setting Up Tailscale VPN on a Home Server
Easily configure secure, private access to your home server using Tailscale VPN. This guide will walk you through the installation, setup, and basic configuration of Tailscale.
Table of Contents
- Prerequisites
- Step 1: Install Tailscale
- Step 2: Start Tailscale
- Step 3: Verify Connectivity
- Step 4: Access Your Home Server Remotely
- Step 5: Optional Configuration
Prerequisites
Before starting, ensure the following:
- Operating System: A Linux-based home server (e.g., Ubuntu, Debian).
- Administrator Access: You need
sudo
privileges on the server. - Tailscale Account: A valid Tailscale account. Sign up here.
Step 1: Install Tailscale
Install Tailscale on your home server with the following commands:
- Update Package Lists:
sudo apt update
- Install Tailscale:
curl -fsSL https://tailscale.com/install.sh | sh
- Confirm Installation:
Verify that Tailscale is installed:
tailscale version
Step 2: Start Tailscale
- Start Tailscale and authenticate:
sudo tailscale up
- Log In:
- After running the command, you’ll be prompted to open a URL in your browser to log in to your Tailscale account.
- Once logged in, your server will join your Tailscale network.
Step 3: Verify Connectivity
- Get Your Tailscale IP:
tailscale ip
This will return an IP in the 100.x.x.x
range, which is the private Tailscale network IP.
- Check Connection Status:
tailscale status
Step 4: Access Your Home Server Remotely
To remotely access your home server from another device:
- Install Tailscale on the remote device:
- Download Tailscale for Windows, macOS, Linux, Android, or iOS.
- Log in using the same Tailscale account.
- Use the Tailscale IP of your home server to connect:
- Example for SSH:
ssh username@100.x.x.x
- Example for SSH:
Step 5: Optional Configuration
Enable MagicDNS
Enable MagicDNS to access your server using human-readable hostnames instead of IPs.
- Open the Tailscale Admin Console:
- Navigate to DNS Settings.
- Enable MagicDNS.
Now you can access your server via its Tailscale hostname:
ssh username@server-name.tailscale.net
Set Up Subdomains for Services
You can use subdomains (e.g., service.mydomain.com
) to access services hosted on your home server:
- Update Your DNS Records:
- Add an A record for the subdomain pointing to your Tailscale IP (
100.x.x.x
).
- Add an A record for the subdomain pointing to your Tailscale IP (
- Set Up a Reverse Proxy (Optional):
- Use Nginx or Traefik to route traffic from the subdomain to specific services on your server.
Example Nginx configuration:
server {
server_name service.mydomain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Conclusion
You’ve successfully installed and configured Tailscale on your home server! Your server is now accessible securely from anywhere. For more advanced configurations, check the Tailscale Documentation.