Skip to main content

Overview

The mullvad connect command establishes a VPN connection to a Mullvad relay server based on your current relay constraints.

Syntax

mullvad connect [OPTIONS]

Options

OptionDescription
-w, --waitWait until connected before exiting
-h, --helpPrint help information

Behavior

When you run mullvad connect:
  1. The CLI checks if you’re logged in to a Mullvad account
  2. If not logged in, it displays a warning and blocks all network traffic until you:
    • Log in to an account with available time/credits
    • Disconnect from the VPN
  3. If logged in, it initiates a connection to a relay matching your current constraints

Examples

Basic Connection

Connect to a VPN relay without waiting:
mullvad connect
The command returns immediately, and the connection process continues in the background.

Wait for Connection

Connect and wait until the connection is fully established:
mullvad connect --wait
This blocks until the tunnel state changes to “Connected” or an error occurs. The command prints tunnel state updates as the connection progresses.

Connection with Short Option

mullvad connect -w

Exit Status

CodeDescription
0Connection initiated successfully (or established if --wait used)
1Failed to connect or not logged in

Notes

  • If you’re not logged in when connecting, Mullvad will block all network traffic as a security measure
  • Use mullvad status to monitor connection progress
  • The relay selection is based on your current relay constraints
  • Connection attempts respect your tunnel configuration settings

Source Reference

Implementation: mullvad-cli/src/cmds/tunnel_state.rs:7

Build docs developers (and LLMs) love