1. Create a VPS
Any provider works. Pick the region you want the IP in, Ubuntu 24.04, and add your SSH key. Note the public IPv4: that is your static IP.
2. Install WireGuard and create keys
sudo apt update && sudo apt install -y wireguard
umask 077
wg genkey | tee server.key | wg pubkey > server.pub
wg genkey | tee laptop.key | wg pubkey > laptop.pub3. Server config
Replace eth0 with your network interface (ip route | grep default):
# /etc/wireguard/wg0.conf
[Interface]
Address = 10.66.0.1/24
ListenPort = 51820
PrivateKey = <contents of server.key>
PostUp = nft add table ip nat; nft add chain ip nat post { type nat hook postrouting priority 100 \; }; nft add rule ip nat post oifname "eth0" masquerade
PostDown = nft delete table ip nat
[Peer]
# laptop
PublicKey = <contents of laptop.pub>
AllowedIPs = 10.66.0.2/324. Enable forwarding and start
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-wg.conf
sudo sysctl --system
sudo systemctl enable --now wg-quick@wg05. Firewall
Allow 51820/udp and SSH (ideally only from your own IP), drop everything else, and block outbound port 25 so nobody can send spam from your IP and ruin its reputation.
6. Client config
[Interface]
PrivateKey = <contents of laptop.key>
Address = 10.66.0.2/32
DNS = 1.1.1.1
[Peer]
PublicKey = <contents of server.pub>
Endpoint = YOUR_SERVER_IP:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25What you are signing up for
- Security updates and reboots, and watching for disk, bandwidth and abuse reports.
- Adding and revoking a peer by hand for every device and person.
- A separate proxy (for example dante or tinyproxy, with authentication) if your apps and CI need the IP too.
- Backups of keys and configs, and rebuilding fast if the VPS dies.
Or let us run it
MazeVPN builds exactly this for you on a dedicated server, with an authenticated HTTPS/SOCKS5 proxy, QR codes for phones, one-click config replacement and 38 cities, from $9.99/month.
Skip the setup
A dedicated server and static IPv4 in 38 cities, ready in about 3 minutes. WireGuard for people, SOCKS5/HTTP proxy for code. From $9.99/month.