← Guides

Build your own static IP VPN with WireGuard

If you are comfortable on a Linux shell, a small VPS and WireGuard give you a static IP for a few dollars a month. This guide uses Ubuntu 24.04.

Updated 2026-11-19 · 8 min read

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.pub

3. 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/32

4. 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@wg0

5. 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 = 25

What you are signing up for

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.

FAQ

Questions, answered.

Something else? Open a ticket, a human replies.

Is the IP really static? +

On almost every VPS provider the primary IPv4 stays the same for the life of the server. Deleting the server releases it.

Can I use IPv6? +

Yes, but many allowlists only accept IPv4, and leaking IPv6 around the tunnel is a common mistake. If you do not need it, disable IPv6 on clients or route ::/0 into the tunnel too.

More guides

Stop getting blocked. Start getting allowlisted.

Your own static IP, live in minutes. Full refund within 3 days if it is not right for you.