Today we are going to learn that how to install Pritunl VPN on Ubuntu 20.04. Pritunl VPN is an open source graphical interface tool that can be used easily. It provides an alternative way to the commercial VPN products. Pritunl VPN has the ability to give access to thousands of users at a time using cloud vpn network. So, let’s move towards the intallation process.
Look at some salient features of Pritunl VPN
Salient features of Pritunl VPN
- Easy to install & configure
- Support Multi Cloud VPN peering
- Provides upto 5 layers of authentication
- Very quick & easy scaling
- Acess to thousands users at a time
- Based on MongoDB
Now, move towards the installation process.
Step 1: Update Your System
First of all, update your system to have the latest packages installed.
sudo apt update && sudo apt upgrade -y
Step 2: Add Pritunl & MongoDB Repositories in Ubuntu 20.04
Once the update is finished, add the Pritunl & MongoDB repositories and public keys in Ubuntu 20.04. To do so run the below command.
echo "deb http://repo.pritunl.com/stable/apt focal main" | sudo tee /etc/apt/sources.list.d/pritunl.list
As Pritunl VPN is basically built from MongoDB so, we’ll also add the MongoDB repository. Simply, fire the below command in your terminal.
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
Now, add the public keys of both by running
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
sudo apt update
Step 3: Install Pritunl & MongoDB on Ubuntu 20.04
Fire the given command in your terminal to install pritunl & MongoDB on Ubuntu 20.04.
sudo apt --assume-yes install pritunl mongodb-server
Once the installation is successfull, hit the below commands to start and enable mongodb services.
sudo systemctl start pritunl mongodb
sudo systemctl enable pritunl mongodb
Step 4: Configure Pritunl on Ubuntu 20.04
Finally configure the Pritunl VPN by visiting your server IP. You’ll see the similar page.
Provide the setup-key by typing the below command.
sudo pritunl setup-key c76683c87efe4774887a9a223a2f1fd6
Now, provide the setup key and MongoDB url on the first page. Run the given command to see the default credentials to login.
root@sabi:~$ sudo pritunl default-password [undefined][2020-11-30 8:01:55,033][INFO] Getting default administrator password Administrator default password: username: "pritunl" password: "xGupSTJtdiJ8"
When you login by entering default credentials generate above, you’ll see the similar page.
Now provide new password & save it then you’ll be redirected to the configuration page where you can configure organization,users & servers.
Click on “Add Organization” button in order to add your organization. Provide the name and click “Add”
You’ll see the similar page when organization added.
In the next step, click on “Add User” to add user. Fill up required details to add user.
In order to add many users at once, navigate to “Bulk Add user”.
Now, to create a VPN server click on “servers” & then “Add server”.
Provide the required details and click “Add” and you’ll see that server has been added as seen below:
Don’t forget to attach the server to organization by clicking on “Attach Organization”.
Step 5: Configure Pritunl Client On Ubuntu 20.04
Now, configure the Pritunl VPN client to connect it to the Pritunl Server. On ubuntu 20.04, type the following command.
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF deb https://repo.pritunl.com/stable/apt focal main EOF sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A sudo apt-get update sudo apt-get install pritunl-client-electron
Once the client is installed, switch back to the server to download the user profile. To do so, go to the “Users” section & click on the download icon. It’ll be like this.
In order to connect to the VPN server, click on Import Profile.
In CLI use the “nmcli” command to connect to the Pritunl VPN. Make sure you’ve the below dependencies installed.
sudo apt-get install network-manager network-manager-openvpn # with Gnome Desktop environment, use: sudo apt-get install network-manager-gnome network-manager-openvpn-gnome
sudo nmcli connection import type openvpn file Lorna_lorna_Pritunl-VPN.ovpn
To start using the profile, run the below command.
nmcli connection up Lorna_lorna_Pritunl-VPN.ovpn
So, this is how you can install Pritunl VPN on Ubuntu 20.04