Pritunl

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    

Installation

Install and configure Pritunl

Below are several methods available for installing Pritunl. When using Amazon AWS it is recommended to use the AMI available below.

Enterprise Clusters

If you intend on creating a Pritunl cluster with multiple hosts all the hosts will need to connect to the same MongoDB database. For cluster configurations it is best to have a dedicated server that is not running Pritunl for the MongoDB database. Single host configurations can run MongoDB with Pritunl on the same server.

Recommended AWS Instance Types

For MongoDB memory optimized instances (r3.large, r3.xlarge) are best and compute optimized instances (c4.large, c4.xlarge) are best for Pritunl nodes. For large deployments several small nodes with fewer connections per node is better then fewer larger nodes with more connections per node. For the best performance it is recommended to spend $0.50-$1.00 per concurrent connection each month on server costs. More information on AWS recommendations can be found in the Scaling documentation.

Amazon AMI

Below are links to an AMI that includes Pritunl and MongoDB. The AMI will automatically upgrade packages to the newest versions on startup.

An AMI is also available that does not come with MongoDB for Enterprise clusters that run a MongoDB server separately from the Pritunl instances:

Ubuntu Automated Install Script

The script below will automate the installation of Pritunl and MongoDB on an Ubuntu 14.04 server. This can be used on DigitalOcean by pasting it in the User Data field.

#!/bin/bash
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list
echo "deb http://repo.pritunl.com/stable/apt trusty main" > /etc/apt/sources.list.d/pritunl.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
apt-get --assume-yes update
apt-get --assume-yes upgrade
apt-get --assume-yes install pritunl mongodb-org
service pritunl start

Linux Repositories

Pritunl is packaged for several Linux distributions, below are the commands for each distribution. This will install both MongoDB and Pritunl then start the services.

$ nano /etc/pacman.conf
[pritunl]
Server = https://repo.pritunl.com/stable/pacman

$ pacman-key --keyserver hkp://keyserver.ubuntu.com -r 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ pacman-key --lsign-key 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ pacman -Sy
$ pacman -S pritunl mongodb
$ systemctl start mongodb pritunl
$ systemctl enable mongodb pritunl
$ sudo nano /etc/yum.repos.d/mongodb-org-3.2.repo
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

$ sudo nano /etc/yum.repos.d/pritunl.repo
[pritunl]
name=Pritunl Repository
baseurl=https://repo.pritunl.com/stable/yum/centos/7/
gpgcheck=1
enabled=1

$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp
$ sudo yum install pritunl mongodb-org
$ sudo service mongod start
$ sudo start pritunl
# SELinux must be disabled

$ sudo nano /etc/yum.repos.d/mongodb-org-3.2.repo
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

$ nano /etc/yum.repos.d/pritunl.repo
[pritunl]
name=Pritunl Repository
baseurl=https://repo.pritunl.com/stable/yum/centos/7/
gpgcheck=1
enabled=1

$ yum install epel-release
$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; rpm --import key.tmp; rm -f key.tmp
$ yum install pritunl mongodb-org
$ systemctl start mongod pritunl
$ systemctl enable mongod pritunl
$ nano /etc/apt/sources.list.d/mongodb-org-3.2.list
deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main

$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt wheezy main

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-org
$ service pritunl start
$ nano /etc/apt/sources.list.d/mongodb-org-3.2.list
deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main

$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt jessie main

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-org
$ systemctl start mongod pritunl
$ systemctl enable mongod pritunl
$ nano /etc/apt/sources.list.d/mongodb-org-3.2.list
deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.2 multiverse

$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt precise main

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-org
$ service pritunl start
$ nano /etc/apt/sources.list.d/mongodb-org-3.2.list
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse

$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt trusty main

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-org
$ service pritunl start
$ nano /etc/apt/sources.list.d/mongodb-org-3.2.list
deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse

$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt xenial main

$ nano /lib/systemd/system/mongod.service
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-org
$ systemctl start pritunl mongod
$ systemctl enable pritunl mongod
$ nano /etc/apt/sources.list.d/pritunl.list
deb http://repo.pritunl.com/stable/apt yakkety main

$ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
$ apt-get update
$ apt-get install pritunl mongodb-server
$ systemctl start pritunl mongodb
$ systemctl enable pritunl mongodb
sudo tee -a /etc/apt/sources.list.d/pritunl.list << EOF
deb http://repo.pritunl.com/stable/apt zesty main
EOF

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
sudo apt-get update
sudo apt-get --assume-yes install pritunl mongodb-server
sudo systemctl start pritunl mongodb
sudo systemctl enable pritunl mongodb

Configuration

Installation

Install and configure Pritunl