DEV Community

Cover image for ##🖥️ Ubuntu Laptop Home Server + Personal VPN (Tailscale Exit Node)
Reginald F. Johnson
Reginald F. Johnson

Posted on

##🖥️ Ubuntu Laptop Home Server + Personal VPN (Tailscale Exit Node)

🖥️ Ubuntu Laptop Home Server + Personal VPN (Tailscale Exit Node)

This guide walks you through converting a laptop with Ubuntu Linux installed into a reliable home server and a personal VPN using Tailscale.

You’ll configure the laptop to stay awake with the lid closed, then set it up as a secure VPN exit node accessible from anywhere.


🔧 Phase 1: Prepare the Hardware

Keep the Laptop Awake With the Lid Closed

Ubuntu suspends when the lid is closed — not ideal for a server.

Disable this behavior:

  1. Open your terminal.
  2. Edit the logind configuration file:
sudo nano /etc/systemd/logind.conf
Enter fullscreen mode Exit fullscreen mode
  1. Find this line:
#HandleLidSwitch=suspend
Enter fullscreen mode Exit fullscreen mode
  1. Remove the # and change it to:
HandleLidSwitch=ignore
Enter fullscreen mode Exit fullscreen mode
  1. Save and exit (Ctrl+O, Enter, Ctrl+X).
  2. Apply the changes:
sudo systemctl restart systemd-logind
Enter fullscreen mode Exit fullscreen mode

Your laptop will now stay awake with the lid closed.


🌐 Turn the Laptop Into a Personal VPN Server

Using Tailscale, you can turn your laptop into a secure VPN server that routes your internet traffic through your home network.

This uses a feature called an Exit Node.


🚀 Step 1: Install Tailscale on Ubuntu

  1. Install Tailscale:

open TERMINAL:

curl -fsSL https://tailscale.com/install.sh | sh
Enter fullscreen mode Exit fullscreen mode
  1. Start and authenticate:
sudo tailscale up
Enter fullscreen mode Exit fullscreen mode

Follow the URL provided to log in with Google, Microsoft, or GitHub.


🔁 Step 2: Enable Exit Node Mode

1. Enable IP Forwarding

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
Enter fullscreen mode Exit fullscreen mode

2. Advertise as an Exit Node

sudo tailscale up --advertise-exit-node
Enter fullscreen mode Exit fullscreen mode

🛡️ Step 3: Approve the Exit Node in the Admin Console

  1. Open the Tailscale Admin Console: https://login.tailscale.com/admin/machines
  2. Find your Ubuntu laptop.
  3. Click the three dots (…)Edit route settings.
  4. Enable Use as exit node.
  5. Save.

Your laptop is now a fully functional VPN server.


📱 Step 4: Connect From iOS or Android

iPhone / iPad (iOS)

  1. Install Tailscale from the App Store.
  2. Log in with the same account.
  3. Tap Exit Node.
  4. Select your Ubuntu laptop.
  5. Toggle the VPN switch to Active.

Android

  1. Install Tailscale from the Play Store.
  2. Log in and accept the VPN permission.
  3. Tap Exit Node.
  4. Select your laptop.
  5. Toggle the connection on.

Your mobile device now routes all traffic through your home server.


🔒 Why This Beats a Commercial VPN

  • Privacy: You own the server — no third‑party logging.
  • Local Access: Reach home files, printers, or cameras from anywhere.
  • Zero‑Config: Tailscale handles NAT, dynamic IPs, and firewall rules automatically.

✔️ Summary

You now have:

  • A laptop that stays awake with the lid closed
  • A secure, self‑hosted VPN server
  • Global access to your home network
  • A privacy‑focused alternative to commercial VPNs

 

Top comments (0)