Install and set up the Pritunl VPN Server software on Ubuntu 22.04

Vinayak S.
4 min readFeb 25, 2023

--

In this tutorial, we’ll look at installing the Pritunl VPN server on Ubuntu 22.04. An open-source VPN server and management system is Pritunl VPN. It makes use of a user-friendly and simple-to-use graphical interface. It offers a suitable substitute for commercial VPN products and is secure. It has the capacity to build a variety of cloud VPN networks that can accommodate more than a thousand users.

Pritunl VPN Client

Characteristics of Pritunl VPN

The following are some of Pritunl VPN’s standout qualities that influence people to choose it:

Easy installation and configuration has multi-cloud VPN peering support
provides up to five levels of authentication, increasing security.

allows clients to choose between using OpenVPN and wireguard because it supports Wireguard.

Scale quickly and easily to thousands of users while maintaining high availability in a cloud environment without the usage of pricey proprietary hardware.

provides official clients for the majority of platforms and devices that support all OpenVPN clients.

Using VPC peering, establish multi-cloud site-to-site connections. For AWS, Google Cloud, Azure, and Oracle Cloud, VPC peering is available.

Pritunl is built on MongoDB.

Review of the Pritunl VPN Architecture

Pritunl VPN presents a distributed and scalable infrastructure that quickly and easily scales to thousands of users, having high availability in the cloud environment without the need for expensive proprietary hardware. It works on server-client architecture, where servers and users are configured on the VPN server and client profiles are downloaded to be used on the clients.

Pritunl is built on MongoDB, a reliable and scalable database that can be quickly deployed. With built-in support for replication, a reliable database can be set up in minutes making a Pritunl cluster deployment fast and easy.

First, you need to update the system and all the available packages to their latest versions.

sudo apt update && sudo apt upgrade

Also, install the required tools.

sudo apt install wget vim curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release

Install Pritunl VPN Server on Ubuntu 22.04

This guide provides two methods on how to install the Pritunl VPN Server on Ubuntu 22.04.:

Using APT

These option entails several steps as shown below:

Add Pritunl and MongoDB repositories and public keys
Now add the Pritunl repository on Ubuntu 22.04.

sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb https://repo.pritunl.com/stable/apt jammy main
EOF

Add GPG keys for the repository:

sudo apt-key adv — keyserver hkp://keyserver.ubuntu.com — recv 7568D9BB55FF9E

MongoDB has no official build for ubuntu 22.04 at the moment.

Download libssl1.1_1.1.1f-1ubuntu2_amd64.deb from the official repository:

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

Install it:

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

Install Pritunl and MongoDB on Ubuntu 22.04
Using the added repositories above, we can easily install Pritunl and MongoDB on Ubuntu 22.04. The command to achieve this is as shown below:

sudo apt update && sudo apt install pritunl mongodb-org

Once the installation is complete, start and enable the Pritunl and MongoDB services:

sudo systemctl start pritunl mongod
sudo systemctl enable pritunl mongod

Confirm service status:

systemctl status pritunl mongod

Configure Pritunl on Ubuntu 22.04

At this point, Pritunl VPN is installed and running. Access it from the browser using your server IP to configure it. http://<your_server_ip>.

Generate setup-key by running the command below:

sudo pritunl setup-key

Once you enter the setup-key and MongoDB URL, it will prompt you for a username and password.

The default username and password are obtained with the below command:

sudo pritunl default-password

When you log in with the provided credentials. Set your new password and save and you should be taken to a page to configure organizations, users, and servers.

To add users, click on ‘Users’. This takes you to a window to first add organization.

Click on ‘Add organization’ then provide it a name then click ‘Add’.

Your organization should now be added.

Click on ‘Add user’ to create a user. Provide the required details and click ‘Add’.

If you want to add many users at once, click on ‘Bulk Add user’.

Let’s now create a Vpn server. Click on ‘servers’ then ‘Add server’.

Provide server particulars and click ‘Add’. You should see that the server has successfully been added.

Remember to attach the server to an organization by clicking on ‘Attach organization’ and choosing your organization.

--

--

Vinayak S.
Vinayak S.

No responses yet