
Commands
Pick your distribution
sudo apt install wireguard # Ubuntu, Debian
sudo dnf install wireguard-tools # Fedora
sudo pacman -S wireguard-tools # Arch
sudo zypper install wireguard-tools # openSUSE
sudo apk add -U wireguard-tools # AlpineThe kernel includes WireGuard since 5.6, so most distributions only add wg and wg-quick. Before Debian 11 enable backports.
Keys
Keep the private one to yourself
umask 077
wg genkey | tee private.key | wg pubkey > public.keyStart, status, boot
The config is /etc/wireguard/wg0.conf
sudo wg-quick up wg0
sudo wg show
sudo systemctl enable wg-quick@wg0It works once wg show prints a latest handshake.
resolvconf: command not found?
The config has DNS and the system lacks that command. Install openresolv or systemd-resolved, or remove the DNS line.
The kernel is too old.
Upgrading is easiest. Failing that use wireguard-go, which is slower.