Skip to main content

WireGuard Easy VPN

Updated over a week ago

Introduction

WireGuard is a free, open-source, and modern virtual private network (VPN) protocol that uses state-of-the-art cryptography. It is designed to be faster, simpler, and more secure than older protocols such as OpenVPN and IPsec, primarily because of its significantly smaller codebase (about 4,000 lines in the Linux kernel version).

The guide is prepared for Ubuntu 24.04 / 22.04 versions.

Updating and upgrading our system

To do so, use:

sudo apt update
sudo apt upgrade

Installing Docker

To install Docker, use:

curl -sSL https://get.docker.com | sh

To check the installed Docker version:

docker --version

Installing wg-easy

Create a directory for the configuration files (you can use any folder):

sudo mkdir -p /etc/docker/containers/wg-easy

Download Docker compose file:

sudo curl -o /etc/docker/containers/wg-easy/docker-compose.yml https://raw.githubusercontent.com/wg-easy/wg-easy/master/docker-compose.yml

To start wg-easy open the created directory:

cd /etc/docker/containers/wg-easy

As a result, you should be in the previously created directory:

root@58zi:/etc/docker/containers/wg-easy

Once we are in the correct directory, we can start wg-easy:

sudo docker compose up -d

Output example:

Container wg-easy Started

Once everything is installed and started, we can set up the no reverse proxy to access the wg-easy admin web UI. Open the docket-compose.yml file:

nano docker-compose.yml

It should open the file as follows:

Here, we need to do so:

  • uncomment environment and INSECURE

  • set INSECURE to true

It is required to allow access to the web UI over an HTTP protocol.

As a result, we should get:

To save the changes, press Ctrl + O and Enter.

To exit the nano editor, press Ctrl + X.

Now, we need to restart wg-easy:

docker compose up -d

As a result, you should get:

Container wg-easy Started

To make sure all our changes are applied, use:

docker exec -it wg-easy env

It will show us all current variables:

Additional steps

If you are using a firewall on your server, you need to unblock UDP port 51820 (WireGuard). This port can be changed, so update your firewall rules accordingly.

Reaching the WireGuard dashboard

To reach the WireGuard dashboard via the browser:

http://your_server_ip_address:51821

It will open a registration WireGuard page:

Click Continue and follow the registration.

Fill in your username and password.

In the next step, it will ask if you have an existing setup. Here you press "NO":

It will open a setup page as follows:

Here we press Suggest >> Select, and find our server IP address (public), and press Change. Leave the port as it is and press Continue.

You should get a notification about successful setup:

Press Sign In to reach your WireGuard account:

Here, we can create clients that can use our WireGuard. To do so, press + New Client. It will ask you for a client name and its expiration date.

To create more clients, press + New.

That's it! You have configured WireGuard Easy VPN and created a client. The next step is to connect to the WireGuard VPN on your device. A WireGuard client can be downloaded below:

If you are using Android or iOS, you can simply scan a QR code. Just press the QR code icon on the left side of the created client and scan it with your phone.

We will install the WireGuard app on a Windows computer. Once it is downloaded, tap the Download Configuration icon next to the QR code, then tap the configuration file to download it.

In our particular case, it will be Dima.conf file.

The following steps open the WireGuard app on our computer, select Import tunnel(s) from file, find your downloaded config file, and press Open.

The configuration file will be added to the WireGuard settings:

To activate your WireGuard VPN, just press Activate.

You should see a result as follows:

To ensure it works properly, we can check our WireGuard dashboard via the browser. It should show traffic going through:

As well, we can just check if our IP is hidden via any IP checker, e.g., https://ip.serveriai.lt/ As a result, you should see your server's IP:

Conlusion

In this guide, we have configured the WireGuard Easy VPN service and tested it on a Windows-based device.

This service can be used for secure remote access for employees, site-to-site connections between offices, or personal use to self-host a VPN server.

Did this answer your question?