In today’s guide, we are studying how to install Pritunl VPN server on Ubuntu 20.04. Pritunl VPN is an open source VPN server and management system. It utilizes an easy-to-use graphical interface. It is safe and provides a good alternative to commercial VPN products. It has the ability to create a wide range of cloud VPN networks, which can support thousands of users.
Features of Pritunl VPN
The following are the most notable features of Pritunl VPN, making it the choice of many people:
- Easy to install and configure
- Support multi-cloud VPN peering
- Provide up to five layers of authentication to make it more secure.
- Support Wireguard, so that customers can choose to connect with openvpn or Wireguard
- Scale quickly and easily to thousands of users, with high availability in the cloud environment, without the need for expensive proprietary hardware
- All OpenVPN clients are supported through official clients of most devices and platforms.
- Create multi-cloud site-to-site links through VPC peering. VPC peering for AWS, Google Cloud, Azure and Oracle Cloud.
- Interconnect AWS VPC networks across AWS regions and provide reliable remote access through horizontally scalable automatic failover
- Pritunl is built on MongoDB, which is a reliable and scalable database that can be quickly deployed
Pritunl VPN architecture review
Pritunl VPN provides a scalable distributed infrastructure that can be quickly and easily expanded to thousands of users, with high availability in a cloud environment, without the need for expensive proprietary hardware. It is suitable for a server-client architecture, where the server and user are configured on the VPN server, and the client configuration file is downloaded to use on the client.
Pritunl is built on MongoDB, which is a reliable and scalable database that can be quickly deployed. With the built-in support for replication, a reliable database can be established in minutes, making Pritunl cluster deployment fast and easy.
Install Pritunl VPN server on Ubuntu 20.04
To install Pritunl VPN server on Ubuntu 20.04, we will follow the steps below:
Step 1: Update the system
Before starting the installation, please run the following commands to update and upgrade the system first:
sudo apt-get update sudo apt-get -y upgrade
Step 2: Add Pritunl and MongoDB repositories and public keys
Next, use the following command to add the Pritunl repository to Ubuntu 20.04.
echo "deb http://repo.pritunl.com/stable/apt focal main" | sudo tee /etc/apt/sources.list.d/pritunl.list
Pritunl VPN is built from MongoDB. We will also continue to add the Mongodb repository using the following command:
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 public keys for MongoDB and Pritunl repositories.
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 and MongoDB
Use the following commands to install Pritunl and MongoDB on Ubuntu 20.04:
sudo apt --assume-yes install pritunl mongodb-server
Now, start and enable Pritunl and MongoDB as follows:
sudo systemctl start pritunl mongodb sudo systemctl enable pritunl mongodb
Step 4: Configure Pritunl on Ubuntu 20.04
At this point, Pritunl VPN is installed and running. Use the server IP to access it from the browser for configuration. http: // <您的服务器_ip>. You should get the following page:
Generate the setup key by running the following command:
$ sudo pritunl setup-key c76683c87efe4774887a9a223a2f1fd6
After entering the setup-key and mongodb url, it will prompt you to enter your username and password.
The default username and password can be obtained with the following command:
$ sudo pritunl default-password [undefined][2020-11-15 18:01:55,033][INFO] Getting default administrator password Administrator default password: username: "pritunl" password: "xGupSTJtdiJ8"
When logging in with the provided credentials, the following page will be displayed:
Set your new password and save it, you should enter a page to configure the organization, users and servers.
To add users, click “User number‘. This will take you to the window where you can add an organization first.
Click ‘Add organization‘Then provide a name and click’plus‘.
Your organization should now be added as follows
Click ‘Add userCreate users. Provide the required details and click “plus‘.
If you want to add many users at once, click “Add users in bulk‘.
Now create a Vpn server. Click ‘server‘Then’Add server‘
Provide the server details and click “plus‘. You should see that the server has been successfully added as shown below:
Remember to attach the server to the organization by clickingAdditional organization‘, and then select your organization.
Step 5: Configure Pritunl client on Ubuntu 20.04
Now, we will configure the Pritunl VPN client to connect to the Pritunl server. For Ubuntu 20.04, run the following command to install Pritunl VPN client.
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
After the client installation is complete, return to the server to download the user configuration file. Click ‘User number‘Select a specific user and click the download icon to get the user profile. It should be similar to the following:
After installing the Pritunl VPN client, you should be able to see that the Pritunl VPN client icon has been installed as part of the application.
Click it and import your configuration file to connect to the Pritunl VPN server.
To connect to the Pritunl VPN server from the terminal, we will use “Antarcticacommand. Make sure that the network manager has been installed on Ubuntu 20.04. If it is not running, run the following command to install:
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
Now run the following command to import the openvpn configuration file
sudo nmcli connection import type openvpn file Lorna_lorna_Pritunl-VPN.ovpn Connection 'Lorna_lorna_Pritunl-VPN' (17636314-1508-4828-9f95-65304af94660) successfully added.
To start using the configuration file, start it with the following command:
nmcli connection up Lorna_lorna_Pritunl-VPN.ovpn
Enjoy the fun of using Pritunl VPN! ! Check out more interesting Linux guides below:
- Install and configure OpenVPN Server on RHEL 8 / CentOS 8
- How to connect to OpenVPN Server using nmcli on Linux
- Use OpenConnect SSL VPN client to connect to VPN Server on Linux
- It is necessary to install VPN on both computers and smartphones.