Follow these steps to install and setup WireGuard VPN client on Ubuntu
Install the WireGuard VPN client
To install the VPN client, you need to run the following command
sudo apt install wireguard
Install ResolvConf
WireGuard relies on resolvconf
to manage DNS settings when bringing up the VPN interface
sudo apt install resolvconf -y
Restart the resolveconf
service
sudo systemctl restart resolvconf.service
Setup the VPN Configuration file
Move the VPN configuration files to the wireguard directory: /etc/wireguard
mv <location of config file>/<config_file.conf> /etc/wireguard/<config_file.conf>
💡 Ensure that the configuration file has a valid name. That is, no special characters only alpha-numeric characters are allowed. For example:
my_vpn
ormy-vpn
is not a valid file name. Instead usemyVPN
ormyvpn
orvpn001
Start up the WireGuard interface using the configuration file:
Change your directory to /etc/wireguard
sudo wg-quick up <config_file_name>
Replace <config_file_name>
with the actual name of your configuration file (without the .conf
extension). For example, if your file is myvpn.conf
, the command would be:
sudo wg-quick up myvpn
You can stop the WireGuard VPN client by running the command: wq-quick down
Verify that the VPN client is running:
sudo wg
To stop the WireGuard VPN, run the following commands
sudo wg-quick down <config_file_name>
You should get a similar output as shown in the screenshot attachment below:
If you followed this tutorial to this point and you get the above result, pat your self on the back. You’ve made it. Now share this to others. Bis später!
Top comments (0)