Log inSign up

Deploy a Pritunl VPN server with a web console

Pritunl is an OpenVPN and WireGuard server with a web console that stores its state in MongoDB. Add the Pritunl, MongoDB and OpenVPN apt repositories, install pritunl mongodb-org openvpn wireguard-tools, enable both services, then open https://198.51.100.24, paste the key from sudo pritunl setup-key and sign in with the credentials from sudo pritunl default-password. Create an organization, add users, attach a server, and users import a profile into the Pritunl client or any OpenVPN app.

Topic: VPN and private DNS · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

Who is Pritunl a good fit for?

Pritunl suits a team that wants user management in a browser: organizations, per-user profiles, PIN codes, two-factor prompts and one-time profile links, all without editing certificate files. Under the hood it drives standard OpenVPN, and it can add WireGuard on the same server. The trade-off is weight: it needs MongoDB, so it uses more memory and disk than a hand-built OpenVPN server. For one person, that hand-built server or a WireGuard tunnel is leaner.

What do you need before installing?

Use Ubuntu 24.04, Ubuntu 22.04 or Debian 12 on a plan with at least 2 GB of RAM, and point a name such as vpn.example.net at 198.51.100.24 if you want a trusted certificate for the console. MongoDB 5.0 and later require the AVX instruction set on x86 processors; check that your vCPU exposes it before you start:

grep -m1 -o 'avx[^ ]*' /proc/cpuinfo || echo "no AVX"

If the command prints no AVX, deploy on a different line such as the AMD EPYC plans. For Debian 13, check the MongoDB and Pritunl package lists for trixie first, since vendor repositories can trail a new Debian release.

How do you add the vendor repositories?

Three signed repositories are needed: Pritunl, MongoDB 8.0 and the upstream OpenVPN builds. On Ubuntu 24.04 (codename noble):

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

echo "deb [signed-by=/usr/share/keyrings/pritunl.gpg] https://repo.pritunl.com/stable/apt noble main" | sudo tee /etc/apt/sources.list.d/pritunl.list
echo "deb [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
echo "deb [signed-by=/usr/share/keyrings/openvpn-repo.gpg] https://build.openvpn.net/debian/openvpn/stable noble main" | sudo tee /etc/apt/sources.list.d/openvpn.list

On Ubuntu 22.04 replace noble with jammy. On Debian 12 use bookworm in the Pritunl and OpenVPN lines, and write the MongoDB line as https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main.

How do you install and start Pritunl?

With the sources in place, one install pulls everything:

sudo apt update
sudo apt install -y pritunl mongodb-org openvpn wireguard wireguard-tools
sudo systemctl enable --now mongod pritunl
systemctl status mongod pritunl --no-pager
pritunl version

MongoDB listens on 127.0.0.1:27017 only, which you can confirm with ss -ltnp | grep 27017. Keep it that way; the database never needs to face the internet.

How do you open the firewall?

Pritunl needs HTTPS for the console, port 80 for certificate validation, and one UDP port per VPN server you create. With ufw:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 1194/udp
sudo ufw enable

Pritunl writes its own forwarding and NAT rules when a server starts. If clients connect but cannot reach the internet while ufw is active, allow routed traffic with sudo ufw default allow routed and reload. Adjust 1194 to whatever port you pick for the server below; the ufw guide explains each rule type.

How do you finish the first-run setup?

Browse to https://198.51.100.24 and accept the temporary self-signed warning. The page asks for a setup key and a MongoDB URI. Print the key on the server:

sudo pritunl setup-key

Paste it, keep the URI mongodb://localhost:27017/pritunl, and save. After a short wait the login page appears; get the initial credentials with:

sudo pritunl default-password

Signing in opens the initial settings dialog. Set your own username and a long password, confirm the public address, and enter vpn.example.net in the Lets Encrypt domain field so the console receives a trusted certificate. From then on use https://vpn.example.net.

How do you add users and a VPN server?

Pritunl groups users into organizations, and servers serve organizations. In the console:

  1. Open Users, add an organization (for example staff), then add users to it, optionally with a PIN.
  2. Open Servers, add a server, set the port to 1194 and protocol UDP, and choose a virtual network such as 10.9.0.0/24. Tick IPv6 if you want clients to receive IPv6 through the tunnel, and enable WireGuard if you want both protocols.
  3. Use Attach Organization to connect staff to the server, then press Start Server.

Back under Users, the link icon next to a user creates a temporary profile link. The user opens it, and either imports the URI into the Pritunl client or downloads an .ovpn file for any OpenVPN app. Those links expire, so a leaked one stops working on its own.

How do you verify, update and troubleshoot it?

A running server shows a green status and lists connected users with their virtual address. On the host, check the services and logs:

sudo journalctl -u pritunl -e --no-pager
sudo pritunl logs | tail -40
ss -ulpn | grep 1194

Updates come through apt like any package: sudo apt update && sudo apt upgrade, then sudo systemctl restart pritunl. Stay on the same MongoDB major unless Pritunl documents support for the next one. For backups, dump the database with mongodump --db pritunl --out ~/pritunl-dump and keep it off the server, or rely on the daily backup add-on for the whole disk. If the console fails to load after a reboot, MongoDB is usually the culprit; journalctl -u mongod shows whether it stopped for lack of memory or disk space.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4MongoDB and console with room2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A2-2small teams2 vCPU, 2 GB RAM, 60 GB NVMe$10.80/mo$64.80 for 6 months

Questions about Pritunl VPN server

Is Pritunl free?

The core server is open source and free to run with unlimited users and servers. Some advanced features are part of paid plans from the vendor; this guide uses only the free features.

Which client apps work with Pritunl?

The official Pritunl client supports profile URIs and PIN prompts. Any standard OpenVPN client imports the .ovpn file, and WireGuard-enabled servers work with the Pritunl client.

I lost the admin password. How do I reset it?

Run sudo pritunl reset-password on the server. It prints a new default login and you change it on next sign-in.

Can MongoDB run on another server?

Yes. Enter a remote URI during setup, but secure that database with authentication and firewall rules, since Pritunl stores all keys in it. A single server keeps things simpler.

Which plan is right for Pritunl?

MongoDB plus the console needs memory, so start with A2-4 (2 vCPU, 4 GB RAM, 100 GB NVMe). A 2 GB plan such as A2-2 works for a handful of users.