In this article, we will have explained the necessary steps to install Pritunl VPN on Rocky Linux 8. Before continuing with this tutorial, make sure you are logged in as a user with
sudo privileges. All the commands in this tutorial should be run as a non-root user.
A Virtual Private Network (VPN) is used to encrypt all traffic thus protecting users and masking users from untrusted networks. Pritunl is an open-source VPN and IPsec server with user management and horizontal scaling for small and large organizations. It gives the user a choice to use OpenVPN and Wireguard protocols. Pritunl is built on MongoDB, a reliable and scalable database that can be quickly deployed and with built-in support for replication, making deploying the Pritunl cluster easy.
Install Pritunl VPN on Rocky Linux 8
Step 1. First, before you start installing any package on your Rocky Linux server, we always recommend making sure that all system packages are updated.
sudo dnf install epel-release sudo dnf update sudo dnf upgrade
Step 2. Install MongoDB.
Now add the package repository:
sudo nano /etc/yum.repos.d/mongodb-org-5.0.repo
Add the following code:
[mongodb-org-5.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
After that, install MongoDB on Rocky Linux 8 using the following command below:
sudo dnf install mongodb-org
Next, start and enable MongoDB:
sudo systemctl enable mongod --now
Step 3. Install Pritunl VPN on Rocky Linux system.
Now add the Pritunl repository to your system:
sudo nano /etc/yum.repos.d/pritunl.repo
Paste the following code:
[pritunl] name=Pritunl Repository baseurl=https://repo.pritunl.com/stable/yum/centos/8/ gpgcheck=1 enabled=1
After that, import the GPG keys:
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp
Now we proceed to install Pritunl:
sudo dnf install pritunl
Next, enable and start the Pritunl service:
sudo systemctl enable pritunl --now
Step 4. Configure Firewall.
To accept the connections from the client over the VPN port, we need to enable it through our firewall:
sudo firewall-cmd --permanent --add-port=18412/udp sudo firewall-cmd --reload
Step 5. Configure Pritunl.
Once complete step-by-step installation, now launches Pritunl by entering
http://<your-server-IP>/ in your browser. Modern-day browsers try to access the HTTPS version of every site, so you will need to bypass the Privacy error thrown by the browser.
First, let’s acquire keys used to authenticate the Database:
sudo pritunl setup-key
Copy the output as it is required in our next step.
Next, run the following command to generate default login information:
sudo pritunl default-password
Then, enter the login information and sign in. You will get the following setup screen.
That’s all you need to do to install Pritunl on Rocky Linux 8. I hope you find this quick tip helpful. For further reading on Pritunl VPN, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.