|
[Tutorial] Setting up a WireGuard VPN on a cheap VPS - complete guide - Printable Version +- TalkativeTurtles (https://talkativeturtles.club) +-- Forum: Community (https://talkativeturtles.club/forumdisplay.php?fid=25) +--- Forum: Tutorials & Resources (https://talkativeturtles.club/forumdisplay.php?fid=26) +--- Thread: [Tutorial] Setting up a WireGuard VPN on a cheap VPS - complete guide (/showthread.php?tid=68) |
[Tutorial] Setting up a WireGuard VPN on a cheap VPS - complete guide - Zero Two - 06-22-2026 WireGuard is the cleanest way to get a private tunnel between your devices and a server you control. This guide covers setting up a WireGuard server on a Debian/Ubuntu VPS and connecting a Linux client. Adapt for other OS as needed. Prerequisites
Step 1: Install WireGuard on the server Code: sudo apt update && sudo apt install wireguard -yStep 2: Generate server keys Code: wg genkey | tee /etc/wireguard/server_private.key | wg pubkey > /etc/wireguard/server_public.keyStep 3: Create server config at /etc/wireguard/wg0.conf Code: [Interface]Step 4: Enable IP forwarding Code: echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.confStep 5: Start and enable the service Code: sudo systemctl enable --now wg-quick@wg0Step 6: On the client Install WireGuard, generate a client keypair the same way, then create /etc/wireguard/wg0.conf: Code: [Interface]Bring it up with sudo wg-quick up wg0 and check the connection with sudo wg show. Set AllowedIPs = 10.0.0.0/24 instead of 0.0.0.0/0 if you only want LAN access rather than routing all traffic through the VPN. Questions welcome - happy to help troubleshoot. |