Skip to content

How to Install and Configure Pritunl VPN Server on Ubuntu 24.04 (Step-by-Step Guide)

AWS Linux Python Security 65 Views 5 min read Updated
How to Install and Configure Pritunl VPN Server on Ubuntu 24.04 (Step-by-Step Guide) - cover image

How to Install and Configure Pritunl VPN Server on Ubuntu 24.04

This guide is based on the supplied Pritunl Manual Word document. It retains the screenshots in their original sequence and organizes the installation commands and web-console steps into a tutorial format.

1. Update Ubuntu and install prerequisites

sudo apt update && sudo apt upgrade -y
sudo apt install wget vim curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release
sudo apt install gnupg -y

2. Configure package repositories

sudo tee /etc/apt/sources.list.d/mongodb-org.list << EOF
deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse
EOF
sudo tee /etc/apt/sources.list.d/openvpn.list << EOF
deb [ signed-by=/usr/share/keyrings/openvpn-repo.gpg ] https://build.openvpn.net/debian/openvpn/stable noble main
EOF
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb [ signed-by=/usr/share/keyrings/pritunl.gpg ] https://repo.pritunl.com/stable/apt noble main
EOF

3. Add repository signing keys

Pritunl setup screenshot image1.png

sudo apt --assume-yes install gnupg
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor –yes
curl -fsSL https://swupdate.openvpn.net/repos/repo-public.gpg | sudo gpg -o /usr/share/keyrings/openvpn-repo.gpg --dearmor –yes
curl -fsSL https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo gpg -o /usr/share/keyrings/pritunl.gpg --dearmor –yes

4. Refresh repositories and install packages

sudo apt update
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt --assume-yes install pritunl mongodb-org
sudo systemctl restart pritunl mongod
sudo systemctl enable pritunl mongod
sudo apt install mongodb-org openvpn wireguard wireguard-tools -y

5. Enable and start Pritunl

sudo apt install pritunl -y

Pritunl setup screenshot image2.png

sudo systemctl enable pritunl
sudo systemctl start pritunl
sudo systemctl status pritunl

Pritunl setup screenshot image3.png

6. Troubleshoot MongoDB startup

sudo systemctl status mongod and service not started then

Pritunl setup screenshot image4.png

Run : sudo systemctl edit mongod

An editor will open. Add:

[Service]
Environment="GLIBC_TUNABLES=glibc.pthread.rseq=1"

Save and exit.

sudo systemctl daemon-reload
sudo systemctl daemon-reload
sudo systemctl restart mongod
sudo systemctl status mongod --no-pager

Pritunl setup screenshot image5.png

sudo systemctl restart pritunl

7. Open the web console

Now Allow Port : 80 & 443 to the public and open server public ip/login

Pritunl setup screenshot image6.png

Click on advanced and proceed to unsafe then below page will appear

Pritunl setup screenshot image7.png

8. Retrieve and enter the setup key

Then in server terminal Run:

sudo pritunl setup-key –You will get 1 key like below and copy and paste the same key on the browser

Pritunl setup screenshot image8.png

Pritunl setup screenshot image9.png

Then page will reload and below page will appear and follow exact instruction

Pritunl setup screenshot image10.png

9. Retrieve the initial administrator password

sudo pritunl default-password  --Then you will get default username and password

Pritunl setup screenshot image11.png

Step screenshot: image11.png

10. Set the administrator password

Set your new password.

Pritunl setup screenshot image12.png

Step screenshot: image12.png

11. Configure time synchronization and VPN port

sudo timedatectl set-ntp true

Allow 15462 port publicly. This port you will get while you are adding server in the add server section

12. Create a VPN server

Click on servers and add server

Pritunl setup screenshot image13.png

Pritunl setup screenshot image14.png

13. Create an organization

Now click on Users and click on Add organization

Pritunl setup screenshot image15.png

Then provide your organization name and click on add.

14. Attach the organization to the VPN server

Now again click on servers and then Attached Organization

Pritunl setup screenshot image16.png

And click attach

Pritunl setup screenshot image17.png

15. Create a VPN user and download its profile

Done. Now go to Users section and add 1 user

Pritunl setup screenshot image18.png

Click on download profile and save the user.tar file

Pritunl setup screenshot image19.png

16. Install the client and import the profile

Download pritunl client from the below link

Link : https://pritunl.com/

Now install the exe and open the application and click on import

Pritunl setup screenshot image20.png

Select your user.tar file and import

Pritunl setup screenshot image21.png

17. Connect and verify the VPN

Now click on OpenVPN and the Pin will be same while creating user and click on connect

Pritunl setup screenshot image22.png

Pritunl setup screenshot image23.png

Now you can check your public IP which will be now your Pritunl Server public IP.

18. Verify the connection

After connecting, verify the VPN client reports connected and confirm your public IP address matches the VPN server egress IP, if full-tunnel routing is intended. If only selected subnets should use the VPN, verify those routes and resources instead.

Troubleshooting and security notes

  • If MongoDB fails to start, inspect sudo systemctl status mongod --no-pager and sudo journalctl -u mongod -n 100 --no-pager. The source manual suggests a systemd override using GLIBC_TUNABLES=glibc.pthread.rseq=1; apply it only if it addresses the actual error on your OS/package version.
  • Check Pritunl service status with sudo systemctl status pritunl --no-pager and logs with sudo journalctl -u pritunl -n 100 --no-pager.
  • Open only the web-console and VPN listener ports required by your setup. The source manual mentions TCP 80/443 and UDP 15462 as an example/configured listener; confirm actual ports in the console and firewall.
  • Do not expose MongoDB port 27017 publicly. Restrict SSH and administration access to trusted IPs, use HTTPS, and store exported user profiles securely.
  • Repository key files and package instructions can change. If APT signature checks fail, resolve the repository/key issue rather than disabling signature validation.

 

Discussion (0)