How to configure a WireGuard VPN on Ubuntu

Step-by-step instructions

1. Create a VPN server with WireGuard connection protocol

Open the program installation manual

Save the WireGuard configuration file from the application

Install WireGuard in Ubuntu

sudo add-apt-repository ppa:wireguard/wireguard && apt-get update && apt-get install wireguard resolvconf -y

Copy the settings from the saved WireGuard configuration file to the /etc/wireguard/wg0.conf file

sudo nano /etc/wireguard/wg0.conf

Run the interface

sudo wg-quick up wg0

Check connection is working (e.g. Whoer.Net)

Your IP on the site should match your VPN server, not the real IP

Add the interface to autoload (if necessary)

sudo systemctl enable [email protected]

Command to stop the VPN interface

sudo wg-quick down wg0

Command to disable WireGuard startup

sudo systemctl disable [email protected]

Удалить WireGuard

$ sudo systemctl disable [email protected] && apt purge wireguard -y && rm -rf /etc/wireguard