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

Options

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:
The command returns immediately, and the connection process continues in the background.

Wait for Connection

Connect and wait until the connection is fully established:
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

Exit Status

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