Setup your private VPN (Wireguard, OpenVPN) in under 2 minutes! (2024)

Setup your private VPN (Wireguard, OpenVPN) in under 2 minutes! (1)

Table of Contents

Increased surveillance and geography-based restrictions are two reasons why VPN (Virtual Private Network) is popular nowadays. But, are all VPNs good for you? No, like anything else, there are features to look out for in every service, including VPNs. The most coveted feature in any VPN is “No-logs policy.” We will discuss all of that in this article, where we will learn how you can setup your own private VPN very easily. You can setup the private VPN server in less than a minute, making this the easiest way to setup your own VPN server. To accomplish that, we will use a very convenient script that makes it possible to setup the VPN server (Wireguard or OpenVPN), set appropriate permissions, add user, etc. in the quickest time possible.

Before we dig deeper, let us quickly understand what a VPN is.

What is a VPN?

Kaspersky defines it in the following way:-

VPN stands for “Virtual Private Network” and describes the opportunity to establish a protected network connection when using public networks. VPNs encrypt your internet traffic and disguise your online identity. This makes it more difficult for third parties to track your activities online and steal data. The encryption takes place in real time.

Some of the most popular services include NordVPN, Mullvad, Private Internet Access, etc.

What is a No-logs VPN?

ExpressVPN explains:-

A no-logs VPN is a VPN service that doesn’t record information about your online activities. This means that your VPN provider will not store your browsing history, downloads, or any other sensitive data.

So, you should always look for a no-logs VPN if you do care extremely for your privacy. But, what’s a better way to make sure no logs are maintained of your online activity? Right, setup your own VPN server.

While this has been possible for a long time, thanks to OpenVPN and Wireguard server, most people shy away due to the difficulty of setting up a VPN server. But, thanks to dev, nyr’s scripts, now, you can setup your own VPN server very easily. Without further ado, let us see how you can setup a private VPN server.

As usual, let us look at the requirements.

Requirements

VPS (Virtual Private Server)

You will necessarily require a VPS for this. Essentially, these are remote machines running an OS of your choice that you can access remotely, with any device. A very basic VPS (1 Core, 1GB RAM) is enough for a VPS server. But, for your convenience, here are some great offers from my new favourite provider, RackNerd. You can check the YABS for their basic plan here. Choose a plan according to your needs.

1GB KVM VPS1.5GB KVM VPS2.5GB KVM VPS
1 vCPU Core1 vCPU Core2 vCPU Cores
15GB SSD RAID 1025GB SSD RAID 1038GB SSD RAID 10
1GB RAM1.5GB RAM2.5GB RAM
2000GB Monthly Bandwidth @1Gbps*4000GB Monthly Bandwidth @1Gbps*6000GB Monthly Bandwidth @1Gbps*
Buy now ($10.99/year)Buy now ($16.88/year)Buy now ($23.88/year)

*LIMITED TIME OFFER: For a limited time, you can get double bandwidth offer, meaning, RackNerd will double the specified bandwidth. So, 1500GB would become 3000GB. To activate this, just comment with your RackNerd order number below this article.

Speaking of needs, choose the location carefully. For example, if you want your IP to be spoofed as one from US, choose a US location for the VPS. As for the OS, you can install almost every other modern OS, as the script we will use, works with Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora. But, for the sake of this tutorial, I will be using Ubuntu 22.04.

Soon after your order is placed, you will receive an email from RackNerd with the VPS’ IP address and root password. Make a note of these.

PuTTY

We will access our VPS using this application. Or, if you are comfortable, you can use SSH on the terminal. In this tutorial, we will stick with PuTTY. Download it here.

OpenVPN/Wireguard client

The client is the other side of the puzzle. We will be using the client to connect to our private VPN on our devices – PCs, phone, consoles, etc. If on Windows, you can download the client directly from Wireguard or OpenVPN. Apps are also available on Play Store and Apple Store. For Linux, find installation instructions for Wireguard here and OpenVPN here.

Now, we are ready to setup the private VPN on our VPS.

Video Tutorial: Setup a private VPN server on any VPS

Or, if you prefer the textual tutorial, keep reading.

How to setup a VPN server on any VPS?

Step 1. SSH into VPS

  1. Start PuTTY. In the field name – Host Name (or IP address), provide the IP address preceded by you received in the email root@. For example, [emailprotected]. Set Port to 22. Click on Open.
  2. A terminal window will open and prompt you for the root password. Enter or copy it onto the window. To copy, copy the password from your email. To paste it onto the PuTTY terminal, just right click. Do note that, the password will not show up as text, asterisk or any other character on the window. When ready, press Enter. This will log you into the VPS.

Step 2. Install VPN Server

Now, you will have to decide which VPN server you need – OpenVPN or Wireguard. You also have the option to install them both on the same VPS. Anyways, the steps for installing them have separately have been given below.

Step 2.1. Install OpenVPN Server on VPS and get configuration file

  1. To install OpenVPN server, copy the installation command, wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh (taken from Nyr’s GitHub page). Paste it onto the PuTTY terminal by right clicking and then, press Enter.
  2. If it asks to choose an IP address, choose the one that you received in your email. You can enter the digit preceding the corresponding IP address and press Enter to select it.
  3. To the question, “Which protocol should OpenVPN use?” just press Enter to select the default protocol – UDP.
  4. Next, it will prompt you to enter a port, with the question, “What port should OpenVPN listen to?” Enter a unique 5 digit number here.
  5. Next up, we have to choose a DNS resolver (“Select a DNS server for the clients“). To set it to the system’s default resolver, just press Enter. Else, if you need automatic ad blocking, choose something like AdGuard.
  6. Next, set a name for the first client. Just enter any name of your liking and press Enter.
  7. Now, press any key to start the installation.
  8. If a popup asks “Which services should be restarted?” use TAB key to select OK and press Enter. The whole process will take roughly under 2 minutes.
  9. Get the contents of the .ovpn (configuration) file for your client. While installing OpenVPN server, you’d have set a client name, let’s suppose it is noob404, in which case the configuration file would be named noob404.ovpn. If confused, run ls to get the file names.
  10. Open the file in PuTTY by typing cat noob404.ovpn and press Enter. Copy everything from client to </tls-crypt> into a file named noob404.ovpn on the device/PC on which you will be connecting to the VPN.

Step 2.2. Install Wireguard Server on VPS and get configuration file

  1. To install Wireguard server, copy the installation command, wget https://git.io/wireguard -O wireguard-install.sh && bash wireguard-install.sh (taken from Nyr’s GitHub page). Paste it onto the PuTTY terminal by right clicking and then, press Enter.
  2. If it asks to choose an IP address, choose the one that you received in your email. You can enter the digit preceding the corresponding IP address and press Enter to select it.
  3. To the question, “Which protocol should Wireguard use?” just press Enter to select the default protocol – UDP.
  4. Next, it will prompt you to enter a port, with the question, “What port should Wireguard listen to?” Enter a unique 5 digit number here.
  5. Next up, we have to choose a DNS resolver (“Select a DNS server for the clients“). To set it to the system’s default resolver, just press Enter. Else, if you need automatic ad blocking, choose something like AdGuard.
  6. Next, set a name for the first client. Just enter any name of your liking and press Enter.
  7. Now, press any key to start the installation.
  8. If a popup asks “Which services should be restarted?” use TAB key to select OK and press Enter. The whole process will take roughly under 2 minutes.
  9. Get the contents of the .conf (configuration) file for your client. While installing Wireguard server, you’d have set a client name, let’s suppose it is noob404, in which case the configuration file would be named noob404.conf. If confused, run ls to get the file names.
  10. Open the file in PuTTY by typing cat noob404.conf and press Enter. Copy everything from [Interface] to PersistentKeepalive = 25 into a file named noob404.conf on the device/PC on which you will be connecting to the VPN.

That’s it! You have successfully setup your VPS for use as VPN. Next, let’s see how you can connect to your private VPN on any device now.

How to connect to private VPN?

These instructions are generic to almost all devices. But, if you are trying to do this on PS4 Linux, make sure you follow this tutorial to setup OpenVPN and Wireguard with modified kernel.

Connect to private VPN using OpenVPN (Windows, Android, iOS)

To connect on Windows, Android, iOS, etc. which offer apps and GUI clients, open the OpenVPN Client/App, use the load profile option, and browse to the .ovpn file we just saved. Then, you can connect and disconnect at will.

Connect to private VPN using OpenVPN (Linux)

  1. Copy the .ovpn file to /etc/openvpn, for example, by running sudo cp noob404.ovpn /etc/openvpn.
  2. To connect to it, type sudo openvpn noob404.ovpn and press Enter.

After that, you can connect to and disconnect from the VPN at will!

Connect to private VPN using Wireguard (Windows, Android, iOS)

To connect on Windows, Android, iOS, etc. which offer apps and GUI clients, open the Wireguard Client/App, use the load profile option, and browse to the .conf file we just saved. Then, you can connect and disconnect at will.

Connect to private VPN using Wireguard (Linux)

  1. Copy the .conf file to /etc/wireguard, for example, by running sudo cp noob404.conf /etc/wireguard.
  2. To connect to it, type sudo wg-quick up noob404 and press Enter.

After that, you can connect to and disconnect from the VPN at will!

Conclusion

Facing issues? Just let me know in the comments below, and will try my best to assist you.

Setup your private VPN (Wireguard, OpenVPN) in under 2 minutes! (2024)
Top Articles
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 6551

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.