How to create a VPN server on your VPS (CentOS 7/8)

In this tutorial you will learn how to create a VPN server on your Virtual Private Server


VPS (with a minimum of 128 mb ram) if this vpn is going to be used by only one person 128mb should be enough but it all depends on the usage, personally I'd recommend 1GB or more to make sure it runs smoothly. Also another thing that is important, you must check the bandwidth on the vps in case you are planning to use it non stop.

OpenVPN software access

CentOS 7/8 installed on your VPS

Step 1 - Update your system

Once you have logged in on your VPS, run the following command below to update your system.

sudo yum update

Step 2 - Add openvpn repository and install openvpn package

Centos 7 (64bit)

Run the command below to add the repository and install the package openvpn-as on CentOS 7

yum -y install
yum -y install openvpn-as

Centos 8 (64bit)

Run the command below to add the repository and install the package openvpn-as on CentOS 8

yum -y install
yum -y install openvpn-as

Step 3 - Access your Server

Once you have completed the installation process you'll get admin ui and web client ui urls on command line

It should be something like this

Admin UI :
Web client :

Admin UI to access admin user interface

Web client is the web interface where you have to login with the same user to download the ovpn file, ovpn file is the file that you have to import to openvpn.

If you are using Windows

Download openvpn software, launch it and then simple import the .ovpn file.

If you are using Linux

Make sure you have openvpn package installed on your system, then you can simply connect by typing the command below on terminal

sudo openvpn --config client.ovpn

You'll be prompted to enter username and password that you set during installation.


How do I change the password?

Run the command passwd openvpn and enter your new password

How do I choose location of the VPN?

The location where VPS is located will be the location for your VPN, so make sure you choose the right location

Can I add more users on my VPN?

Openvpn free plan allows up to two devices, so you can add two devices for free, in case you want to add more you need to buy an license

Check pricing by clicking to the official OpenVPN's website.


By now you should know how to create your vpn server on your Virtual Private Server.


Endrit Qerreti

Web Development, IT, Linux System Administration, Security Researcher, Computer Technician