Pritunl Documentation

Welcome to the Pritunl developer hub. You'll find comprehensive guides and documentation to help you start working with Pritunl as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Replicated Servers

Replicate Pritunl servers for load balancing and high availability

This tutorial will describe creating a replicated configuration with two Pritunl servers. The diagram below shows the network topology for this tutorial.

Replication involves sharing a single virtual VPN network across multiple hosts, this is done with a combination of VXLans and routing. Replication will not improve the reliability of a VPN and has greater complexity that is more prone to configuration errors. A simple multi-host server will automatically failover to other available hosts and be more reliable then a replicated server.

MongoDB Server

Both Pritunl servers will need to be able to access the same database server. This is used for inter-server communication. Services such as Compose can be used to easily deploy a reliable replicated MongoDB cluster. When configuring a self hosted MongoDB cluster the instructions in Securing MongoDB should be followed to enable authentication and SSL on the MongoDB cluster.

Initial Setup

After a MongoDB cluster has been deployed all the Pritunl servers must be configured to connect to the same MongoDB cluster. If a Pritunl server has already configured the MongoDB uri it can be reconfigured by running the command pritunl reconfigure followed by restarting the Pritunl service.

Configure Server

First configure a VPN server that will be replicated. The Pritunl hosts should all be on the same local network for replication. Then attach the hosts to the server.

Once the hosts have been attached increase the Replication Count in the advanced server settings. The server configuration should look similar to the example below with multiple hosts listed. When the server is started both hosts will come online and users will randomly connect to one of the hosts.

Replicated Servers

Replicate Pritunl servers for load balancing and high availability