Pritunl is a web UI and admin orchestration layer on top of OpenVPN and (more recently) WireGuard. It is the answer for teams who want a Tailscale-style admin experience but need the underlying tunnels to be plain OpenVPN/WireGuard for compatibility or compliance reasons. This article covers the install we run, the MongoDB backend it depends on, SSO integration, and the trade-offs versus building it yourself.
How to verify
Pritunl wants to own MongoDB, ports 80/443 (for the admin UI), and one or more UDP ports for the actual VPN traffic. Confirm the box is clear before installing.
ss -lntp | grep -E ':(80|443|27017)\b'
ss -lunp | grep -E ':1194\b'
dpkg -l | grep -E 'mongodb|openvpn|pritunl'
systemctl list-unit-files | grep -E 'pritunl|mongod'
Pritunl pins specific MongoDB versions. If you already have MongoDB on the host for an application, do not share it — install MongoDB dedicated for Pritunl, or use the official pritunl-mongo package.
What’s happening
Pritunl is a Python application that orchestrates openvpn server processes (and a WireGuard kernel interface if you enable the WireGuard option). When you create an organization, user, and server in the UI, Pritunl writes the OpenVPN config, generates the per-user PKI, and spawns the daemon. User profiles are issued through the UI or API; clients connect with the Pritunl Client app or any standard OpenVPN/WireGuard client.
State lives in MongoDB — users, organizations, server configs, audit log. The web UI talks to MongoDB; the OpenVPN processes are children of the Pritunl supervisor. SSO is handled at the UI/profile-fetch layer: a user logs into Pritunl with SAML or OIDC, then downloads their profile.
The trade-off versus self-managed OpenVPN is the same as Tailscale versus self-hosted WireGuard: you give up some flexibility in exchange for a cleaner admin model. The upside: profile issuance, revocation, and audit happen in the UI without anyone editing config files. The downside: you now have a Pritunl-shaped piece of software in your dependency graph that needs its own patching, backups, and uptime.
The procedure
-
Install MongoDB and Pritunl from official apt repos.
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \ gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] \ https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" \ > /etc/apt/sources.list.d/mongodb-org-7.0.list curl -fsSL https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | \ gpg --dearmor -o /usr/share/keyrings/pritunl.gpg echo "deb [signed-by=/usr/share/keyrings/pritunl.gpg] \ https://repo.pritunl.com/stable/apt jammy main" \ > /etc/apt/sources.list.d/pritunl.list apt update apt install -y pritunl mongodb-org systemctl enable --now mongod pritunl -
Initialize Pritunl and grab the setup key.
pritunl setup-keyBrowse to
https://<server>and paste the key. Confirm the MongoDB URI it auto-detected (mongodb://localhost:27017/pritunl). -
Get the initial admin password.
pritunl default-passwordLog in, change the password, enable MFA on the admin account.
-
Configure SSO. Pritunl supports SAML, OIDC, Google Workspace, Microsoft Entra, and Okta out of the box. In the admin UI under “Users” -> “Single Sign-On,” paste the IdP metadata. Make sure the IdP attribute that becomes the Pritunl username matches what your audit logs care about (
emailis the usual choice). -
Create an organization and a server.
- Organization: groups users (e.g. “engineering”).
- Server: an actual OpenVPN/WireGuard listener. Pick
wgmode if you want WireGuard. - Attach the organization to the server. Default route, DNS pushed, port and protocol — all in the UI.
-
Add users. With SSO, users self-provision when they first log in. Without it, click “Add user” and enter email. Pritunl emails a one-time link to the user to download their profile.
-
Open the firewall.
ufw allow 443/tcp ufw allow <vpn-port>/udp ufw allow OpenSSH ufw enable -
Distribute the Pritunl Client. The client (macOS/Windows/Linux) imports profiles directly from a one-time link emitted by the server. We disable manual
.ovpnexport and rely on the link flow — it lets us revoke by invalidating the link.
Common pitfalls
- Sharing MongoDB with another application — Pritunl assumes ownership of the DB and will write schema versions that break other consumers.
- Skipping
pritunl set-mongodbafter a restore from backup — the daemon caches the URI; if the backup is restored to a different MongoDB host, Pritunl will hang trying to reach the old one. - Letting the certificate authority generated by Pritunl expire silently — there is no email when the internal CA hits its rotation date. Calendar it.
- Allowing direct OpenVPN profile download outside the Pritunl-Client one-time link flow — you lose revocation by link expiry and inherit OpenVPN’s CRL workflow instead.
- Running Pritunl as root for the OpenVPN children — fine for the daemon, but the actual
openvpnprocesses should still drop privileges (user nobody / group nogroupin advanced server settings).
In the engagements we run, Pritunl is a good fit when the client wants the admin polish of a Tailscale-style console but their compliance officer wants the data path to be plain OpenVPN they can audit packet-for-packet. The Managed Operations layer treats Pritunl the same as any other identity-adjacent system: backed up daily, patched on schedule, and on-call covered for “VPN is down” tickets.