Mullvad VPN Client Build Instructions

Most of the instructions in this file is for internal use at Mullvad to create installers. If you have downloaded our source distribution and read this because you want to be able to install that, skip directly to Installing from source distribution.

Running unit tests

Run all tests

python -m unittest discover [-v] src/

To run specific test modules you can provide a path as the last argument to the above command

python -m unittest discover [-v] src/
python -m unittest discover [-v] src/ "test_*"

You can also run indicidual tests or test cases with the following command, if you are located in the package root, i.e. src

python -m unittest tests.test_config
python -m unittest tests.test_config.TestSettings
python -m unittest tests.test_config.TestSettings.test_set

Generate new pot/po files

python pot

Compile locale directory from po files

sudo aptitude install python-setuptools gettext
python locale

Source distribution

python sdist

Debian package

Do the locale steps above and then issue these commands:

sudo aptitude install python-stdeb
python --command-packages=stdeb.command bdist_deb


Download and install the following:

Install the following Python dependencies using pip:

pip install appdirs ipaddr netifaces psutil

Build Mullvad:

python locale
python py2app
python dmg

Troubleshooting on OSX

If the locale step fails for OSX because of a missing "msgfmt" command it might be that you installed gettext from homebrew, which does not link the binaries to the standard path because of collisions with OSX native gettext library, in that case manually add it to your path in the terminal where you build it:

export PATH=/usr/local/Cellar/gettext/<version>/bin:$PATH

Windows installer

Setup build environment

Download and install the following:

NSIS also needs the following plug-ins to support the Windows installer script. They are installed by placing the relevant files in the NSIS/Plugins directory.

Install the following Python dependencies using pip:

pip install appdirs ipaddr netifaces psutil jinja2

Build the installer

Generate the locale files (must be done on linux):

python locale

Run build.bat on the Windows build machine

Installing from source distribution

pip install appdirs ipaddr netifaces psutil
pip install mullvad-XX.tar.gz  # XX is the version that you have

You also need the other dependencies: openvpn, python-wxgtk3.0 or python-wxgtk2.8, python-gtk2, python-appindicator and resolvconf. If you want to use obfsproxy you have to build it yourself from as the newer versions currently don't work with Mullvad.