Skip to main content
The Mullvad CLI (mullvad) is a command-line interface for managing the Mullvad VPN daemon. It provides complete control over VPN connections, relay selection, tunnel configuration, and account management.

Binary Name

The CLI tool is named mullvad (or mullvad.exe on Windows).

Basic Usage

mullvad [COMMAND] [OPTIONS]

Getting Help

Display general help information:
mullvad --help
Get help for a specific command:
mullvad [COMMAND] --help
For example:
mullvad relay --help
mullvad tunnel set --help

Version Information

Check the CLI version:
mullvad --version
View detailed version information:
mullvad version

Quick Examples

Connection Management

Connect to VPN:
mullvad connect
Connect and wait until connected:
mullvad connect --wait
Disconnect from VPN:
mullvad disconnect
Check connection status:
mullvad status
Get verbose status information:
mullvad status --verbose

Account Management

Log in to your account:
mullvad account login [ACCOUNT_NUMBER]
View current account information:
mullvad account get
Log out:
mullvad account logout

Relay Selection

List available relays:
mullvad relay list
Set relay location by country:
mullvad relay set location se
Set relay location by city:
mullvad relay set location se got
View current relay constraints:
mullvad relay get

Available Command Categories

The Mullvad CLI provides the following command categories:

Core Commands

  • connect - Connect to a VPN relay
  • disconnect - Disconnect from the VPN
  • reconnect - Reconnect to any matching VPN relay
  • status - Return the state of the VPN tunnel

Account Management

  • account - Control and display information about your Mullvad account
    • Create accounts
    • Login/logout
    • View account details and device information
    • Manage devices

Relay Configuration

  • relay - Manage relay and tunnel constraints
    • List available relays
    • Set location constraints (country, city, hostname)
    • Configure relay providers and ownership
    • Update relay list
    • Override relay options

Tunnel Settings

  • tunnel - Manage tunnel options
    • MTU configuration
    • Quantum-resistant key exchange
    • DAITA (Defense Against AI-Guided Traffic Analysis)
    • Allowed IPs
    • Key rotation interval

Network Settings

  • dns - Configure DNS servers to use when connected
  • lan - Control the allow local network sharing setting
  • split-tunnel - Configure split tunneling (platform-specific)

Security & Privacy

  • lockdown-mode - Control whether to block network access when disconnected from VPN
  • auto-connect - Control the daemon auto-connect setting
  • anti-censorship - Manage use of anti-censorship methods for WireGuard

Advanced Configuration

  • api-access - Manage Mullvad API access methods
    • Configure proxy and bridge servers
    • Manage SOCKS5 and Shadowsocks proxies
  • custom-list - Manage custom relay lists
  • beta-program - Receive notifications about beta updates

Data Management

  • factory-reset - Reset settings, caches, and logs
  • reset-settings - Reset settings only, but remain logged in and keep logs and caches
  • import-settings - Apply a JSON patch generated by ‘export-settings’
  • export-settings - Export a JSON patch based on the current settings
  • log - Manage logs and tracing

Debugging

  • debug - Debug commands used for internal testing (hidden)

Output Formats

Many commands support different output formats:

Verbose Mode

Use the -v or --verbose flag for detailed output:
mullvad status --verbose
mullvad account get --verbose

JSON Output

Some commands support JSON output with the -j or --json flag:
mullvad status --json

Debug Output

For debugging purposes, use the -d or --debug flag:
mullvad status --debug

Interactive Features

Wait Flags

Connection commands support --wait (or -w) to block until the operation completes:
mullvad connect --wait
mullvad disconnect --wait
mullvad reconnect --wait

Status Listening

Monitor tunnel state changes in real-time:
mullvad status listen

Confirmations

Destructive operations like factory reset require confirmation unless you use -y or --assume-yes:
mullvad factory-reset --assume-yes
mullvad reset-settings -y

Shell Integration

Shell Completions

On Unix systems (Linux and macOS), you can generate shell completion scripts:
mullvad shell-completions bash
mullvad shell-completions zsh
mullvad shell-completions fish

Communication with Daemon

The CLI communicates with the mullvad-daemon system service using a management interface. The daemon must be running for the CLI to function. If you encounter connection errors, ensure the daemon is running:
  • Linux: systemctl status mullvad-daemon
  • macOS: Check if the daemon process is active
  • Windows: Check if the Mullvad service is running in Services

Exit Codes

The CLI returns standard exit codes:
  • 0 - Success
  • Non-zero - Error occurred
This makes the CLI suitable for use in scripts and automation.

Next Steps

Build docs developers (and LLMs) love