In this tutorial, we will show you how to install Pritunl VPN Server on Ubuntu 20.04 LTS. For those of you who didn’t know, the Pritunl VPN server is a free, open-source enterprise VPN server that anyone can use to set up a secure VPN tunnel across networks. It provides a simple and user-friendly web interface and has the ability to create a wide range of cloud VPN networks. It provides an official client package and supports all OpenVPN clients for most devices and platforms.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Pritunl VPN Server on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Pritunl VPN Server on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade sudo apt install curl gnupg2 wget unzip
Step 2. Installing Pritunl VPN Server on Ubuntu 20.04.
Now we add the Pritunl repository key and file to the Ubuntu system:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv E162F504A20CDF15827F718D4B7C549A058F8B6B sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
Next, add its repository file using the following command:
echo "deb http://repo.pritunl.com/stable/apt focal main" | sudo tee /etc/apt/sources.list.d/pritunl.list
Once the repository is added, update the repository cache and install the Pritunl server with the following command:
sudo apt update sudo apt install pritunl
Once the installation completes, you can set up the start, stop and enable the Pritunl VPN server to automatically start up when the server boots:
sudo systemctl stop pritunl sudo systemctl start pritunl sudo systemctl enable pritunl
Step 3. Installing MongoDB.
By default, MongoDB is not available in the Ubuntu 20.04 default repository so you will need to add the MongoDB repository to your system:
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
Update apt
and install MongoDB using the following command:
sudo apt update sudo apt-get install mongodb-server
Step 4. Accessing Pritunl.
Now, open your web browser and access the Pritunl web Interface using the URL https://your-server-ipaddress
. You should see the following screen:
Next, generate a setup key using the command below:
sudo pritunl setup-key
Output:
from cryptography import x586 c879d9o59b10012084887b2g4ua5g49u
After that, copy the setup key and paste it to the Pritunl database setup wizard. After paste, the setup key, click on the Save button.
Next, you will need to generate a default username and password to sign in. To do that, run the following command:
sudo pritunl default-password
Output:
from cryptography import x586 [undefined][2021-03-09 12:09:16,430][INFO] Getting default administrator password Administrator default password: username: "pritunl" password: "meilana123"
Now login with the default username and password, and set up your environment from Pritunl dashboard.
Congratulations! You have successfully installed Pritunl VPN. Thanks for using this tutorial for installing the Pritunl VPN Server on your Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official Pritunl website.