Skip to main content
The Mullvad VPN command-line interface (CLI) provides full control over the VPN client through terminal commands. It’s ideal for automation, scripting, and advanced users who prefer terminal-based workflows.

Overview

The CLI communicates with the mullvad-daemon system service to control all VPN functionality.

Binary Name

Platform Availability

  • Windows: mullvad.exe (in Program Files)
  • macOS: /usr/local/bin/mullvad
  • Linux: /usr/bin/mullvad
The CLI is automatically installed with the desktop application on all platforms.

Installation

Desktop Platforms

The CLI is included with the desktop app installation:
  • Automatic: Installed alongside the GUI application
  • PATH: Added to system PATH during installation
  • Permissions: No special permissions required (communicates with daemon)

Verify Installation

Should display the installed version.

Basic Usage

Connection Management

Connect to VPN

Disconnect from VPN

Reconnect

Check Status

Example output:

Account Management

Manage your Mullvad account:

Login

Account Information

Logout

Device Management

Server Selection

List Available Servers

Set Server Location

Server Constraints

Tunnel Configuration

WireGuard Settings

Multihop

DAITA

Obfuscation

Configure obfuscation to bypass censorship:

Anti-Censorship Settings

DNS Configuration

DNS Settings

Content Blocking Options

  • ads - Block advertisements
  • trackers - Block tracking domains
  • malware - Block malicious domains
  • gambling - Block gambling sites
  • adult - Block adult content
  • social-media - Block social media platforms

Split Tunneling

Configure application exclusions:

Application-Based Split Tunneling

Security Settings

Auto-Connect

Lockdown Mode

Local Network Sharing

API Access Methods

Configure how to reach Mullvad API:

Custom Lists

Create and manage lists of favorite servers:

Settings Management

Export Settings

Import Settings

Reset Settings

Beta Program

Opt in/out of beta updates:

Logging

Manage logging and tracing:

Debugging Commands

Debug commands are hidden and intended for internal testing. They may set the app in an invalid state.

Shell Completions

Generate shell completion scripts (Linux/macOS):

Installing Completions

Bash

Zsh

Fish

Scripting Examples

Auto-Connect on Specific Network

Rotate Between Servers

Monitor Connection Status

Connection Test Script

Output Formats

Many commands support JSON output for scripting:

Exit Codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - General error
  • Other non-zero values indicate specific errors

Example Error Handling

Environment Variables

The CLI respects standard terminal environment variables:
  • NO_COLOR - Disable colored output
  • MULLVAD_RPC_SOCKET_PATH - Override daemon socket path (advanced)

Troubleshooting

CLI Cannot Connect to Daemon

Command Not Found

Permissions Errors

The CLI communicates with the daemon via socket/pipe:
  • Linux: User must have access to /var/run/mullvad-vpn socket
  • macOS: Similar to Linux
  • Windows: All users should have access by default
To restrict access (Linux/macOS):

Next Steps

Desktop Guide

Learn about the desktop application

Automation

Automate VPN with scripts

Settings Reference

Detailed settings documentation

Troubleshooting

Common CLI issues and solutions