How to set up a private VPN with the Wireguard protocol on a VPS?

Would you like to run your own VPN on a VPS? Do you have a VPS running with a permanent Internet connection or a home server you would like to use as a VPN? How can you set up a private VPN for you to use? It isn’t hard to setup a VPN using the Wireguard protocol, especially not if you follow the instructions given in this article.

The first thing you need is a VPS. If you want to borrow a VPS for this purpose, I can warmly recommend Contabo and VPSServer. The first is the best, but VPSServer is also a good option. They are cheap, making them much better solutions than competitors such as Vultr, Linode, and DigitalOcean. You should only pay attention to the traffic you plan to route through the VPS as you purchase a subscription. The cheapest packages with the slowest systems are more than enough for running the VPN itself, but if you plan to route lots of traffic through the VPS, consider the bandwidth limitations.

Are you ready to continue? It is time to set up the VPN on your VPS. As you purchase your VPS, choose the newest version of Ubuntu as the operating system for your server.

Set up a VPN with the Wireguard protocol on a eVPS.

The first thing you should do on your VPS is to run the following commands to update all the files on the system.

sudo apt update && sudo apt upgrade -y

When this is done, run the following command.

sudo wget https://git.io/wireguard -O wireguard-install.sh
sudo chmod 744 wireguard-install.sh
sudo ./wireguard.install.sh

This will download the Wireguard installation file to your system. It will later ensure the file is executable and run the installation file. You will see your IP address in the process, and you can give the client a name. You can select any DNS server in the process (you can freely choose one of the options), and in the end, you will see a QR code that you can use on your cell phone or tablet. This contains information about your VPN.

the vpn is up and running.

Would you like to connect to the Wireugard server using a mobile device?

Would you like to connect to the VPN server using a mobile phone or tablet? Download the Wireguard application from Apple Store or Google Play Store. After installing the application, add a new VPN connection in the Wireguard application by scanning the QR code. You will immediately be ready to connect to the VPN server.

Would you like to connect to your VPN using a computer?

If you want to connect to the VPN using a computer, downloading the Wireguard application from the Wireguard website is a good start. Following this, you need to set up the connection to your newly created VPN server. How is this done?

As you set up the VPN on the VPS, a configuration file was created in the /root folder. If you called the client “Thomas”, you will see a file named Thomas.conf in the /root folder. Now you have a couple of options.

You can copy the configuration file’s content and create a new file with the same name and content on your computer.

cat /root/Thomas.conf

This command will show you the content of the file. Copy the content to a new document on your computer and use that as the configuration file when you set up the connection in your Wireguard program.

You can also use the scp command to copy the configuration from the VPS to your device securely, but the above solution is easier for most people.

You need to be root to see the content of the root directory. If you are logged in as a different user, change to the root user by running the following command.

su -

If you don’t have root access, you cannot access the Wireguard configuration file in the /root directory.


You are now ready to connect to your newly created VPN server that you are running on your own VPS. Isn’t that an awesome feeling?

Why do you want to set up a VPN? Why do people use VPNs?

So far, we have only described how to set up a VPN. That leads us to another question, why use a VPN at all? Here you have some of the most popular reasons.

  1. Security: VPNs encrypt all internet traffic, which helps protect users’ online activities from hackers, eavesdropping, and other forms of cybercrime.
  2. Privacy: VPNs can hide a user’s IP address and location, making it more difficult for websites, advertisers, and others to track their online activities.
  3. Access to geo-restricted content: VPNs allow users to access websites and online services that are blocked or restricted in their location. This can include websites only available in other countries, such as streaming services, social media platforms, and online forums.
  4. Bypass censorship: VPNs can bypass censorship and access the internet freely, especially in countries with strict internet censorship laws.
  5. Remote work: VPNs allow remote workers to securely access their company’s internal network and resources, such as email and file servers, from any location.
  6. Protection on public Wi-Fi: VPNs help protect users’ online activities when they connect to public Wi-Fi networks, which are often unsecured and can put users at risk of hacking and other cyber attacks.
  7. Improve network performance: VPNs can help improve network performance by reducing network latency and improving bandwidth. This can be particularly useful for gaming and other online activities that require fast and stable internet connections.

Now that we understand why it is important to use a VPN, the question is which VPN protocol to use.

Is the Wireguard protocol the best VPN protocol?

Whether Wireguard is the “best” VPN protocol is subjective and depends on several factors, such as the user’s specific needs and preferences. However, Wireguard has received praise for its speed, simplicity, and security.

Wireguard is a relatively new VPN protocol designed to focus on speed, ease of use, and security. Compared to other VPN protocols, such as OpenVPN and IPSec, Wireguard is faster and uses fewer system resources, which can lead to improved performance. Additionally, Wireguard’s design is simpler and more secure than other VPN protocols, making it easier to maintain and audit for vulnerabilities.

However, it’s important to note that Wireguard is still relatively new and has not been widely adopted or extensively tested in the same way as other VPN protocols. Some users may also prefer other protocols, such as OpenVPN, for their wider compatibility and more advanced features.

In conclusion, while Wireguard has received positive reviews for its speed, simplicity, and security, whether it is the “best” VPN protocol is subjective and depends on the user’s specific needs and preferences.

Leave a Reply