How to install Pritunl VPN server on CentOS 8

You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose

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

Pritunl VPN Server supports OpenVPN and Wireguard. VPN runs in a server-client architecture so that the client connects to a remote VPN server, and routing is handled by the remote Pritunl VPN server.

In this article, we will introduce how to install Pritunl VPN server on CentOS 8. RHEL 8 Linux system. Please follow the steps below to set up Pritunl VPN server in a hosting environment:

Step 1: Install MongoDB server

  • Add MongoDB and Pritunl repository –

MongoDB:

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/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.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 key
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 services
sudo systemctl start mongod pritunl
sudo systemctl enable mongod pritunl

Confirm service statistics:

$ 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 Tue 2021-01-05 06:08:23 UTC; 31s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 6818 (mongod)
   Memory: 90.8M
   CGroup: /system.slice/mongod.service
           └─6818 /usr/bin/mongod -f /etc/mongod.conf

Jan 05 06:08:21 centos systemd[1]: Starting MongoDB Database Server...
Jan 05 06:08:21 centos mongod[6773]: about to fork child process, waiting until server is ready for connections.
Jan 05 06:08:21 centos mongod[6773]: forked process: 6818
Jan 05 06:08:23 centos mongod[6773]: child process started successfully, parent exiting
Jan 05 06:08:23 centos 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 Tue 2021-01-05 06:08:21 UTC; 33s ago
 Main PID: 6767 (pritunl)
    Tasks: 18 (limit: 4763)
   Memory: 147.0M
   CGroup: /system.slice/pritunl.service
           ├─6767 /usr/lib/pritunl/bin/python2 /usr/lib/pritunl/bin/pritunl start
           └─9918 pritunl-web

Jan 05 06:08:21 centos systemd[1]: Started Pritunl Daemon.
Jan 05 06:08:23 centos pritunl[6767]: /usr/lib/pritunl/lib/python2.7/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer su>
Jan 05 06:08:23 centos pritunl[6767]:   from cryptography import x509

Step 1: Install MongoDB server

Configure Pritunl VPN Server on CentOS 8 | RHEL 8

At this point, Pritunl is up and running and can be accessed by https://server-ip. Run the following command to obtain the key that will be used for database authentication:

sudo pritunl setup-key

Copy the output to a text editor Because it will be needed in the next step.

When accessing the web interface, the following interface will be displayed. Paste the output of the previous command into “Enter the setup key“Field and save.

You will be redirected to a login page asking for a username and password. Use the following command to obtain credentials from the server:

sudo pritunl default-password

This will generate an output on the terminal containing the username and password you should use when logging in on the web interface.

Install pritunl vpn centos8

You can then proceed to the server setup, the first step is to change the default credentials.

Then, we can now access the dashboard without configured users, servers, or organizations.

pritunl web interface

Pritunl uses organizations and groups users into organizations to enable configuration of access control and centralized management. Then, you can create a server that will be attached to the organization. The server can only be linked to one organization, and users can also link.

Configure Pritunl server

We continue to configure the server.

  • Go to User number Label and select Add organization:

pritunl add organization

Give your organization a name and click plus

  • Click on Add user Add users and link users to the organization we created in the previous step. Enter the PIN code that the user needs to enter when connecting to the server.

Add user pritunl

  • Add server over there server label.

pritunl create server

Name the server and specify the VPN subnet and DNS that will be used for client connections. You can also keep the default configuration.

Install pritnul vpn centos8

select Enable WireGuard Activate the wireguard client connection.You can advanced then press plus.

The successfully added server is shown below.Click on Additional organization Link the server with the organization created in the previous step.

Create server pritunl vpn

Click on Add route Add a route to the private network you want the VPN client to access

Now, we must download the user profile, and the client will use the user profile to connect.

Go to User number Tab, and then navigate to the user whose profile you want to download. The download options are on the right side of the user, as shown below:

Download user profile pritunl vpn

How to configure Pritunl client

This guide will introduce how to download and install Pritunl Client on Centos 8.

  1. 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

2. Add and import Pritunl GPG key

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

3. Install Pritunl VPN client:

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

4. Start Pritunl VPN client and click Import data. Select the configuration file we downloaded in the previous step and import it.

Connect vpn pritunl vpn

On the menu icon in the upper right corner, click connection Options. This will require the PIN set during the user creation process we discussed.

Install pritunl vpn centos 8 1

After successful authentication, you will be connected to the VPN and can be seen from the VPN server dashboard

Install pritunl vpn centos 8 2

We have successfully installed and configured Pritunl VPN on CentOS 8, and set up the client. Check out other interesting articles:

Install and configure OpenVPN Server on RHEL 8 / CentOS 8

How to connect to OpenVPN Server using nmcli on Linux

Install and configure Pritunl VPN server on Ubuntu 20.04

You can download this article in PDF format via the link below to support us.Download the guide in PDF formatClose

Sidebar