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:Node.js and npm
You need Node.js 22.21.1 and npm 11.7.0 (specified in the volta section ofdesktop/package.json).
Linux:
Go
Install Go 1.21 or newer from golang.org.Protobuf Compiler
Install protobuf compiler version 3.15 or later:- Linux:
protobuf-compilerpackage, plus:- Fedora:
protobuf-devel - Debian/Ubuntu:
libprotobuf-dev
- Fedora:
- 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
~/.cargo/config.toml:
Nix Devshell
Supported on Linux (x86_64) and macOS (x86_64 and aarch64):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
clangon PATH- ARM64 Rust target:
Compiling on Windows ARM
Additional requirements:clangfrom Visual Studio in PATH- Correct
INCLUDEenvironment variable (runvcvarsall.bat arm64or sourcevcvars.sh) - x64 grpc-tools binaries:
macOS
Required:- Recent version of bash (not the default 3.2.57)
clangfor 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 [email protected] - 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:--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:Android
Containerized build (recommended):iOS
Configure Xcode project:.xcconfig files with your team ID and provisioning profiles.
Then build through Xcode or command line tools.
Building Individual Components
Mullvad Daemon
-
macOS only: Source environment variables:
-
Windows only: Build C++ libraries:
-
Build the daemon:
-
Windows only: Run as SYSTEM user using PsExec:
-
Run the daemon:
Desktop Electron App
-
Navigate to desktop directory:
-
Install dependencies:
-
Start in development mode:
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:-
Build proto files on non-ARM64 platform:
-
Copy proto files from:
desktop/packages/mullvad-vpn/src/main/management_interface/desktop/packages/mullvad-vpn/build/src/main/management_interface/
-
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
Ensureprotoc is in your PATH and version 3.15+: