Skip to content
Step by Step Internet 🌐 Guides for learning to surf the Net

How to install and configure a VPN on a VPS server with OpenVPN? step by step guide

UPDATED ✅ Do you need to set up a VPN network on your VPS server to encrypt your traffic? ⭐ ENTER HERE ⭐ and discover how to do it ✅ EASY

When we use a virtual private server or VPS we are generating the link between two points, which we will call a tunnel and we will be able to send a flow of data packets in a secure way without being intercepted by intruders.

The VPS can be used on any type of platform, being a solution for the different hardware and software that exist in the configuration of the network to which they belong.

As a requirement, the implementation of this technology, we have to take into account that we need a static IP provided by our Internet provider, as well as having the operating system updated. In this article we will show you all the benefits and steps that are needed for the implementation of a VPS in Windows or Linux.

What are the benefits of setting up a VPN tunnel on a VPS server?

What are the benefits of setting up a VPN tunnel on a VPS server

The first thing we have to say is that VPN is a virtual private network. To connect to a website, we first need to issue our request to it. to router and this sends it to the Internet provider, which contacts our VPN and we just access the page server.

In this way, what we are doing is increasing our level of security and avoiding the geolocation of our computer.

We can also talk there are VPNs that are free and others for which we will have to pay for them, but neither of the two alternatives are secure enough. This is because servers, especially free ones, can offer our data to third parties in certain situations.

This is why if we have confidence in a home Internet connection, we can create our own VPN, which we will call VPS (Virtual Private Server). We can configure this tool like any virtual private network and we will protect our Internet traffic in a more secure way.

For it, we will use a tool called OpenVPNwhich will help us encrypt the data end-to-end.

The advantages of using a VPS network are the following:

  • Can access anywhere in the world via the Interneteven if there are local restrictions, since we will enter from where the servers are hosted.
  • We managed to have remote access to another computer using the same VPS, moreover, is very difficult for unauthorized users. In this way we can also share resources, for example, a printer.
  • Our internet traffic is secure because it is end-to-end encrypted.
  • We do not depend on software of a VPN, which many times have to share our data in a mandatory way.
  • Have a relatively low cost regarding memberships of virtual private networks.
  • It is much more secure than using a virtual private network.
  • We can connect to any network regardless of its security level.
  • We will always navigate in a hidden way.

Why choose OpenVPN to protect the IP of your virtual private server?

Why choose OpenVPN to protect the IP of your virtual private server

OpenVPN is a software that allows us to carry out a P2P type connectivity, between different devices that may be in different places in the world. One of its main characteristics is that static IPs are not needed on both sides of the tunnel.

This technology was developed in 2001 by james yonanwhich was improved thanks to the different contributions of the users. It is considered one of the most practical and easy-to-use tools for those users with little network experience.

It can be implemented in the business environment, where it is used for the connection between different points of the same company through the Internet. It is also used when two companies need to share their information privately, without having to upload that data to a public or easily accessible site for intruders.

thanks to this tool users who have remote access are protected because they need to enter with keys or passwords in their different devices, even if they are not directly connected to the network.

Also, can be used with any firewall and only one port of it is needed for OpenVPN to work, since the software is the one with the multiports.

OpenVPN can also work as a server waiting for incoming connections or also starting connections to it, thus allowing it to run as a TCP service.

If we have to talk about some limitations of this technology, we have to refer to its little knowledge among people who manage networkswe can also mention that is not supported for its protocols that secure IP addresses with encryption in a data stream packetthat is to say the IPsec.

Steps to configure OpenVPN on a VPS on Windows or Linux easily and quickly

Steps to configure OpenVPN on a VPS on Windows or Linux easily and quickly

We detail below how we have to configure OpenVPN in a virtual private server.

on Windows

To configure OpenVPN on a Windows operating system we will follow this guide:

  • We obtain the necessary keys so that we can connect to the openvpn server using the command /build-key usuariovpnwhich we will type into a DOS window.
  • We copy these keys to a USB stick, or we write cp /etc/openvpn/keys/* /media/usb
  • With this command we will obtain all the copies of the content of /etc/openvpn/keys.
  • We create a file in the location /etc/openvpnwith the name client.conf on the server.
  • Again we copy this file to our USB stick with the command cp /etc/openvpn/client.conf /media/usb
  • We download OpenVPN from its official website:
  • We open the location of the executable file.
  • We choose the option “Execute as an administrator”.
  • In the message that will appear we choose the option “Yes”.
  • Next, we click on “Next”.
  • We choose all the components that we want to install.
  • We select “Next”.
  • We look for the installation path for the program which is usually C:/Archivos de programa/OpenVPN.
  • We click on “Next”.
  • Next, we press “Finish”.
  • We open our USB memory and verify its content looking for the file “client.conf”.
  • We change the extension of that folder to “client.ovpn”.
  • We copy the keys from memory to the location C:/Archivos de programa/OpenVPN/configchoosing only: crt; whezzyVPN.crt; usuariovpn.key; usuariovpn.crt; ta.key y client.ovpn.
  • Now we go to the IPAP tool to know what my IP is.

In this way it is demonstrated that our public IP is not the same as always.

To connect to the server we have to create a shortcut icon and right click on it and choose the option “Execute as administrator”.

on linux

When our Linux operating system is used, we will have to install a script. To do this we must perform the following step by step:

  • We go to our control panel and in the tab “Settings” we activate “TUN/TAP” Y “dpi”.
  • We update the server by typing apt-get update Y apt-get upgrade.
  • We install OpenVPN with the command wget --no-check-certificate -O; chmod +x; ./ezopenvpn.
  • At this time, all the programs that are necessary to function will be installed, we copy the file to our PC, for which we will carry out the following command scp -P 2424 [email protected]:~/ ~/.

In order to have an OpenVPN tunnel in a graphical way:

  • We will use the following command sudo apt-get install network-manager-openvpn.
  • We select “Net”.
  • We look for the option “VPN connections”.
  • We click on “Configure VPN”.
  • We choose the option if we want a wireless or wired Internet connection.
  • We click on “Add”.
  • We open the “.ovpn file”.
  • We click on “To create”.
  • We choose the tab “VPN”.
  • We write in “General” the IP address.
  • Next, we select the “User Certificate” “client-ubuntu.crt”.
  • We write in “CA Certificate” “ca.crt”.
  • In “private key” we will add “client-ubuntu.key”.
  • And we choose a password from the private key.
  • We click on “Save”.