How To Install Wireguard on Debian 11

Install Wireguard on Debian 11

In this tutorial, we will show you how to install Wireguard on Debian 11. For those of you who didn’t know, Wireguard is one of the well-known and a great open-source VPN solutions. Wireguard aims for better performance and more power than IPsec and OpenVPN. Wireguard protocol passes traffic over UDP.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Wireguard VPN server on a Debian 11 (Bullseye).

Install Wireguard on Debian 11 Bullseye

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt upgrade

Step 2. Installing Wireguard on Debian 11.

Now we download the script installation Wireguard from the Github repository:

curl -O

Next, make the file downloaded executable and run it:

chmod +x


Install Wireguard on Debian 11

Step 3. Client Configuration.

Once successfully installed and configuring, the script will prompt you for client configuration and it will only do the two things and that is:

Install Wireguard on Debian 11

The rest of the client setup will be done automatically by the script and you should get the result like in the following picture, with the QR code listed for ease of client setup:

Install Wireguard on Debian 11 Bullseye

Next, we download the .ovpn client file (you can use an SSH client with an integrated file manager such as Bitwise.) On Linux you can download the file with SFTP:

sftp [email protected]
get client_config.ovpn

After that, start WireGuard and enable it at boot:

sudo wg-quick up wg0
sudo systemctl start [email protected]
sudo systemctl enable [email protected]

To establish the connection from the client to the server, on the client machine, install the Wireguard client and run the following command below to connect:

client sudo wg-quick up client_config.conf

Step 4. Firewall Configuration.

If you are using UFW, you will be required to allow port 51820 through the firewall:

sudo ufw allow ssh
sudo ufw allow 51820/udp

Congratulations! You have successfully installed Wireguard. Thanks for using this tutorial for installing the latest version of the Wireguard VPN server on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official Wireguard website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!