Skip to content

Wireguard Install


Add the Package source, only required for Debian 10 and lower.
Debian 11 Bullseye include Wireguard.

echo "deb unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/wireguard

apt update
apt install wireguard


Keys Generieren

cd /etc/wireguard
umask 077
wg genkey > privatekey
wg pubkey < privatekey > publickey

Example Config

Address =, fd28:10:0:1::3/128 # (1)!
PrivateKey = <Private Key> 

PublicKey = <Public Key of Peer>
PresharedKey = <Pre Shared Key optional>
AllowedIPs =, ::/0 # (2)!
Endpoint = <Endpoint>:51820
  1. Addresses of the local machine
  2. Networks for which the Wireguard connection should be used.