Update your system
sudo apt update
sudo apt upgrade
Installing a WireGuard VPN
Generating private and public keys
To get started with generating the keys for the server change into the WireGuard directory.
Next, set the permissions for the directory with the following command. Note that you need to be logged in with the root account to do this.
Then with the required permissions set, generate a new key pair with the command below.
wg genkey | tee privatekey | wg pubkey > publickey
Copy your Publickey
Open your Selfmade Ninja Labs Dashboard and navigate to Dashboard > My Devices > Add Device
Fill the following fields
- Device Name, Device Type, and Wireguard Public Key (You Copied Earlier)
- Check the Primary Device if needed
- Check the Trusted Device if that is your personal device
Click Add Device
Your device will be added ✅
You can check your Wireguard configuration by clicking the blue action button in the Actions tab
Copy the configuration and add it to wg0.conf file
Generate server configuration
We are then set to start configuring the WireGuard server. The config files are generally stored in /etc/wireguard folder. Create a new configuration file called wg0.conf in that folder.
sudo nano /etc/wireguard/wg0.conf
Copy the configuration and add it to your tunnel configuration.
Paste the configuration and save
Now activate the Wireguard VPN
You will be Connected to the Wireguard VPN server
wg-quick up wg0
Try to ping the server
You are all done connecting to our Wireguard VPN server ✅