How to Install and configure Pritunl server

Pritunl VPN

About Pritunl

Pritunl is a free and open source cross platform OpenVPN and WireGuard client.

Installing Pritunl requires only a MongoDB database and no registration is needed to use the free version of Pritunl.

Features of Pritunl VPN
Below are the most notable features of Pritunl VPN that makes it an option for many:

  • Simple to install and configure
  • Supports multi-cloud VPN peering
  • Offers upto five layers of authentication making it more secure.
  • Supports Wireguard, giving clients theoption to connect with openvpn or Wireguard
  • Quickly and easily scale to thousands of users, having high availability in the cloud environment without the need for expensive proprietary hardware
  • supports all OpenVPN clients with official clients for most devices and platforms.
  • Create multi-cloud site-to-site links with VPC peering. VPC peering available for AWS, Google Cloud, Azure and Oracle Cloud.
  • Interconnect AWS VPC networks across AWS regions and provide reliable remote access with automatic failover that can scale horizontally
  • Pritunl is built on MongoDB, a reliable and scalable database that can be quickly deployed

Installing Pritunl on Ubuntu 20.04

Step 1: Update your system

Update and upgrade your system before beginning installation

sudo apt update && sudo apt -y full-upgrade

Step 2: Create installation script

  • Create a bash file
nano install-pritunl.sh
  • Copy and paste the code below into the file:
#!/bin/bash
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb http://repo.pritunl.com/stable/apt focal main
EOF
# Import signing key from keyserver
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
# Alternative import from download if keyserver offline
curl https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list << EOF
deb https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse
EOF
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
sudo apt update
# WireGuard server support
sudo apt -y install wireguard wireguard-tools
sudo ufw disable
sudo apt -y install pritunl mongodb-org
sudo systemctl enable mongod pritunl
sudo systemctl start mongod pritunl

  • Close the editor with Ctrl+X and save it with Y
  • Make the file executable:
chmod +x install-pritunl.sh

Step 3: Install Pritunl and MongoDB

  • Run the script
./install-pritunl.sh

Step 4: Configure Pritunl on Ubuntu 20.04

Pritunl VPN is installed and running. Access it from the browser using your server IP to configure it.

How to Install and configure Pritunl server

  • Generate setup-key
sudo pritunl setup-key

Once you enter the setup-key and mongodb url, it will prompt you for username and password.

  • Get the default username and password with the below command:
sudo pritunl default-password
  • Login with the provided credentials

How to Install and configure Pritunl server

  • Set your new username and password, put your desired domain instead of IP(optional) 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’.
  • Click on ‘Add user’ to create a user. Provide the required details and click ‘Add’.
  • Click on ‘servers’ then ‘Add server’

How to Install and configure Pritunl 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.
  • Start the server

Step 4: Download and install Pritunl client

You can find instructions for other Linux distributions or Cloud providers at the link below:

https://docs.pritunl.com/docs/installation