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

0

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

Requirements:

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 https://as-repository.openvpn.net/as-repo-centos7.rpm
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 https://as-repository.openvpn.net/as-repo-centos8.rpm
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 : https://xx.xx.xx.xxx:943/admin
Web client : https://xx.xx.xx.xxx:943

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 and simply import the ovpn file

If you are using Linux

You don't need to download anything, you can connect easily via a simple command

sudo openvpn --config client.ovpn



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

FAQ

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 here - https://openvpn.net/access-server/pricing/

Conclusion

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

Author

Comments