Skip to main content

Overview

This guide covers building the Mullvad VPN app from source for desktop (Windows, macOS, Linux), Android, and iOS platforms.

Prerequisites

All Platforms

Rust Toolchain

Get the latest stable Rust toolchain via rustup.rs. Install default targets and components for your platform:
Optionally, install a git post-checkout hook that automatically runs setup-rust when the Rust version changes:

Node.js and npm

You need Node.js 22.21.1 and npm 11.7.0 (specified in the volta section of desktop/package.json). Linux:
macOS:
Windows: Install the msi from volta-cli/volta

Go

Install Go 1.21 or newer from golang.org.

Protobuf Compiler

Install protobuf compiler version 3.15 or later:
  • Linux: protobuf-compiler package, plus:
    • Fedora: protobuf-devel
    • Debian/Ubuntu: libprotobuf-dev
  • macOS: brew install protobuf
  • Windows: Download binaries from GitHub and add to PATH

Bash

Bash 4.0 or later must be installed and available in PATH on all platforms.
  • Linux: Usually installed by default
  • macOS: Install via Homebrew: brew install bash (default 3.2.5 is not supported)
  • Windows: Install Git for Windows which includes Git Bash

Linux

Debian/Ubuntu

Fedora/RHEL

Cross-compiling for ARM64

Add to ~/.cargo/config.toml:

Nix Devshell

Supported on Linux (x86_64) and macOS (x86_64 and aarch64):
Optionally use direnv for automatic sourcing:

Windows

Required components:
  • Build Tools for Visual Studio 2022 (or Visual Studio 2022 Community/Pro)
  • Windows 10/11 SDK
  • Bash and Unix utilities (see All Platforms section)
  • zig 0.14 or later, available in PATH: ziglang.org/download
  • msbuild.exe available in PATH:
    Or source vcvars.sh: . ./scripts/vcvars.sh
  • x86 target for NSIS plugins:

Cross-compiling for ARM64

Requirements:
  • ARM64 MSVC tools in Visual Studio
  • clang on PATH
  • ARM64 Rust target:

Compiling on Windows ARM

Additional requirements:
  • clang from Visual Studio in PATH
  • Correct INCLUDE environment variable (run vcvarsall.bat arm64 or source vcvars.sh)
  • x64 grpc-tools binaries:

macOS

Required:
  • Recent version of bash (not the default 3.2.57)
  • clang for CGo

Android

See the Android Build Instructions for detailed setup including:
  • JDK 17
  • Android SDK and NDK
  • Android-specific Rust targets

iOS

Required dependencies:
  • Go 1.21: brew install go@1.21
  • Rust with iOS targets: ./scripts/setup-rust ios
  • Protobuf compiler: brew install protobuf
  • Xcode configuration with team ID and provisioning profiles

Building the Complete App

Desktop Platforms

The simplest way to build the entire app and generate an installer:
Add --optimize to enable compiler optimizations (longer build, smaller binaries). This produces an installer (exe, pkg, rpm, or deb) in the dist/ directory. Minimum memory requirement: 1GB

Target-Specific Builds

macOS Universal Binary:
Linux ARM64:
Windows ARM64:

Android

Containerized build (recommended):
Manual build:

iOS

Configure Xcode project:
Edit the generated .xcconfig files with your team ID and provisioning profiles. Then build through Xcode or command line tools.

Building Individual Components

Mullvad Daemon

  1. macOS only: Source environment variables:
  2. Windows only: Build C++ libraries:
  3. Build the daemon:
  4. Windows only: Run as SYSTEM user using PsExec:
  5. Run the daemon:

Desktop Electron App

  1. Navigate to desktop directory:
  2. Install dependencies:
  3. Start in development mode:
Changes to JavaScript files will automatically reload. Note: The Electron app requires a running daemon to connect to.

Development Commands

Desktop/Electron

Rust/Cargo

Special Build Cases

ARM64 Linux Hosts

Due to protobuf limitations, building on ARM64 Linux requires a 2-stage process:
  1. Build proto files on non-ARM64 platform:
  2. Copy proto files from:
    • desktop/packages/mullvad-vpn/src/main/management_interface/
    • desktop/packages/mullvad-vpn/build/src/main/management_interface/
  3. Build on ARM64 with proto files:
    May also need: USE_SYSTEM_FPM=true

Troubleshooting

Build requires at least 1GB memory

If builds fail with memory errors, ensure your system has adequate RAM or increase swap space.

Protobuf compiler not found

Ensure protoc is in your PATH and version 3.15+:

Node/npm version mismatch

Use Volta to automatically manage Node.js versions:

Bash version too old (macOS)

The default macOS bash (3.2.5) is too old. Install bash 4.0+: