How to autostart Wireguard using systemd (wg-quick)

This post is also available in: Deutsch (German)

If you’ve added a wg-quick config, e.g. /etc/wireguard/wg0.conf, you can enable autostarting it on system boot using systemd:

sudo systemctl enable --now wg-quick@wg0

If you have started Wireguard with this config manually before, you need to shut it down first or systemd will not be able to start it !