Install WireGuard

sudo apt install wireguard
wg genkey | tee privatekey | wg pubkey > publickey

Server Config

# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = SERVER_PRIVATE_KEY
Address = 10.0.0.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT

[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
sudo wg-quick up wg0
sudo systemctl enable wg-quick@wg0