Applies to: LifeinCloud Cloud VPS • Ubuntu 22.04 LTS
Overview
WireGuard is a fast, modern VPN protocol that is simple to configure. LifeinCloud offers a 1-click WireGuard image, but here’s how to set it up manually.
Requirements
- LifeinCloud VPS running Ubuntu 22.04.
- Root SSH access.
Step 1 — Update the VPS
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
Step 2 — Install WireGuard
apt install -y wireguard qrencode
Step 3 — Generate Keys
umask 077
wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
Step 4 — Create Configuration File
nano /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.1/24
PrivateKey = (contents of /etc/wireguard/privatekey)
ListenPort = 51820
SaveConfig = true
[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
Step 5 — Enable and Start WireGuard
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
Step 6 — Firewall Rules
ufw allow 51820/udp
Note: To avoid manual setup, deploy the 1-click WireGuard VPN image from the LifeinCloud control panel.