How to Install and Configure Pritunl VPN Server on Ubuntu 24.04 (Step-by-Step Guide)
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 -y2. 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
EOF3. Add repository signing keys
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 –yes4. 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 -y5. Enable and start Pritunl
sudo apt install pritunl -ysudo systemctl enable pritunl
sudo systemctl start pritunl
sudo systemctl status pritunl6. Troubleshoot MongoDB startup
sudo systemctl status mongod and service not started thenRun : 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-pagersudo systemctl restart pritunl7. Open the web console
Now Allow Port : 80 & 443 to the public and open server public ip/login
Click on advanced and proceed to unsafe then below page will appear
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 browserThen page will reload and below page will appear and follow exact instruction
9. Retrieve the initial administrator password
sudo pritunl default-password --Then you will get default username and password10. Set the administrator password
Set your new password.
11. Configure time synchronization and VPN port
sudo timedatectl set-ntp trueAllow 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
13. Create an organization
Now click on Users and click on Add organization
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
And click attach
15. Create a VPN user and download its profile
Done. Now go to Users section and add 1 user
Click on download profile and save the user.tar file
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
Select your user.tar file and import
17. Connect and verify the VPN
Now click on OpenVPN and the Pin will be same while creating user and click on connect
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-pagerandsudo journalctl -u mongod -n 100 --no-pager. The source manual suggests a systemd override usingGLIBC_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-pagerand logs withsudo 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)