Top up $1,000 or more and get 50% extra credit on every plan.
OffshoreVPSService
VPS

Set up your own WireGuard VPN

Turn a VPS into a private VPN in minutes.

6 min read · Updated: 2026-11-14

Install

apt install wireguard
umask 077
wg genkey | tee server.key | wg pubkey > server.pub

Server config

Create /etc/wireguard/wg0.conf:

[Interface]
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = <contents of server.key>
PostUp = sysctl -w net.ipv4.ip_forward=1; iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

[Peer]
PublicKey = <client public key>
AllowedIPs = 10.8.0.2/32

Replace eth0 with your interface name (ip a).

Start

systemctl enable --now wg-quick@wg0
ufw allow 51820/udp

Client

Create a client key pair and a config with Endpoint = YOUR_IP:51820 and AllowedIPs = 0.0.0.0/0. Import it into the WireGuard app.

Stuck on a step?

Dedicated and GPU customers can open a ticket. Everyone else can use server actions in the client area.

How support works →