28. January 2022

How to install and configure Pritunl VPN server on CentOS Stream 8

By H. Cemre Günay

Pritunl VPN is one of the most secure open source VPN tools that are currently available for multi-cloud VPN peering. Pritunl VPN server uses MongoDB and can be deployed on any cloud infrastructure.

Pritunl VPN Server supports OpenVPN and Wireguard. The VPN operates in a server-client architecture in such a way that the clients connect to the remote VPN server and routing is handled by the remote Pritunl VPN server.

In this article we shall cover how to install Pritunl VPN server on CentOS 8 | RHEL 8 Linux system. Follow the steps below to setup Pritunl VPN server on your hosted environment.

As always please don’t forget, if you are root you don’t need to use sudo in your commands! Let’s start:

Step 1: Install MongoDB Server – Add the repositories for MongoDB and Pritunl –

Add MongoDB Repository

sudo tee /etc/yum.repos.d/mongodb-org.repo<<EOF
[mongodb-org]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
EOF

Add Pritunl Repository

sudo tee /etc/yum.repos.d/pritunl.repo<<EOF
[pritunl]
name=Pritunl Repository
baseurl=https://repo.pritunl.com/stable/yum/centos/8/
gpgcheck=1
enabled=1
EOF

Add Pritunl VPN GPG keys

sudo gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A
sudo gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp

Install EPEL-Release

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Install Pritunl and MongoDB

sudo yum -y install pritunl mongodb-org

Start and enable MongoDB, Pritunl service

sudo systemctl start mongod pritunl
sudo systemctl enable mongod pritunl

Confirm status of the services:

# systemctl status mongod pritunl
● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-01-28 06:40:02 EST; 1min 56s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 26708 (mongod)
   Memory: 149.0M
   CGroup: /system.slice/mongod.service
           └─26708 /usr/bin/mongod -f /etc/mongod.conf

Jan 28 06:40:00 irgNET-vpn01 systemd[1]: Starting MongoDB Database Server...
Jan 28 06:40:00 irgNET-vpn01 mongod[26641]: about to fork child process, waiting until server is ready for connection>
Jan 28 06:40:00 irgNET-vpn01 mongod[26708]: forked process: 26708
Jan 28 06:40:02 irgNET-vpn01 mongod[26641]: child process started successfully, parent exiting
Jan 28 06:40:02 irgNET-vpn01 systemd[1]: Started MongoDB Database Server.

● pritunl.service - Pritunl Daemon
   Loaded: loaded (/etc/systemd/system/pritunl.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-01-28 06:40:00 EST; 1min 58s ago
 Main PID: 26633 (pritunl)
    Tasks: 19 (limit: 11348)
   Memory: 303.4M
   CGroup: /system.slice/pritunl.service
           ├─26633 /usr/lib/pritunl/bin/python /usr/lib/pritunl/bin/pritunl start
           └─31153 pritunl-web

Basically that’s it, the configuration of the Pritunl’s itself is the same as in my tutorial from Debian 10, so I would ask you to take the further steps from there.

If you have any questions please leave a comment down below. 🙂