The Easiest Wireguard VPN Set Up Method

Monday, January 01 2024

Backstory

I recently tried getting Wireguard up and running with a single Server and Peer. First I followed the quickstart guide at https://www.wireguard.com/quickstart/, thinking it'd be a quick exercise. I meticulously documented all the steps that had to be run on the Server, and the Peer so that I'd have a thorough understanding of the set-up process. 10 minutes soon turned into 2 hours, and things still weren't working. I was ready to look for another solution.

Digital Ocean's guides have been great learning resources for me in the past, and so I decided to try their Wireguard set-up guide. Long story short, it did not result in my IP address changing.

The last guide I tried to follow was by a business called uplcloud.com. Surely their terse list of commands would results in a different IP address? Well, no. So, what I ended up doing is what I've always done.

Guide

Leveraging the installation script developed at https://github.com/angristan/wireguard-install, run:

curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh

sudo ./wireguard-install.sh

Go through the prompted questions. The defaults options are fine - this script will iterate IP addresses of Wireguard peers for you automatically.

At the end of the script, it will output a QR code for you to scan which is very helpful if you are using Wireguard mobile (available on iOS and Android). Just scan it, and you're good to go.

A .conf file will also be created at the end of the script's execution. Copy it onto your Peer's device via FileZilla, scp, or rsync (scp -P 1234 user@1.2.3.4:/home/user/wg0-client-one.conf .). Rename it to <interface name>.conf, for example wg0.conf, then enter wg-quick up /path/to/wg0.conf. To turn off your VPN on your Peer, enter wg-quick down /path/to/wg0.conf.

You can test if everything is working by running curl https://ipinfo.io/ip, or by visiting https://whatismyipaddress.com/.

Comment
Optional
No comments yet...