English
简体中文繁體中文EnglishРусскийفارسی

Home › Download › Linux

Install on Linux

Official commands to install WireGuard on each distribution, why the tools are enough since kernel 5.6, wg and wg-quick, start at boot and status.

WireGuard is built into the Linux kernel
WireGuard is built into the Linux kernel Vee Satayamas, CC BY 2.0

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         # Alpine

The 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.key

Start, status, boot

The config is /etc/wireguard/wg0.conf
sudo wg-quick up wg0
sudo wg show
sudo systemctl enable wg-quick@wg0

It 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.

On the same round

Postcodes: WireGuard Linux install, WireGuard Ubuntu, wg-quick