-
Install
sudo apt update sudo apt upgrade -y sudo apt install wireguard
-
Configure Server
Copy the following contents to
/etc/wireguard/default.conf
:## Set Up WireGuard VPN on Ubuntu By Editing/Creating wg0.conf File ## [Interface] ## My VPN server private IP address ## Address = 192.168.6.1/24 ## My VPN server port ## ListenPort = 41194 ## VPN server's private key i.e. /etc/wireguard/privatekey ## PrivateKey = x [Peer] ## Desktop/client VPN public key ## PublicKey = w ## client VPN IP address (note the /32 subnet) ## AllowedIPs = 192.168.6.2/32
-
Start Server Service
sudo systemctl start wg-quick@default
-
Enable Server Service On Restarts (Optional)
sudo systemctl enable wg-quick@default
Mostly copied from: https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server