Skip to main content

Overview

The mullvad auto-connect command controls whether the VPN automatically connects when the Mullvad daemon starts.

Syntax

Subcommands

get

Display the current auto-connect setting:

set

Change the auto-connect setting:
Arguments:
  • on - Enable automatic connection on startup
  • off - Disable automatic connection (manual connection required)

Behavior

Auto-Connect ON

When auto-connect is enabled:
  • VPN automatically connects when the Mullvad daemon starts
  • Connection happens at system boot (if daemon starts automatically)
  • Uses current relay constraints for server selection
  • Reconnects automatically if connection drops
  • Provides “always-on” VPN functionality

Auto-Connect OFF

When auto-connect is disabled:
  • VPN remains disconnected at startup
  • Manual connection required using mullvad connect
  • Gives you control over when to connect

Examples

Check Current Setting

Output when enabled:
Output when disabled:

Enable Auto-Connect

Output:

Disable Auto-Connect

Output:

Use Cases

Always-On VPN Protection

Enable auto-connect for continuous protection:
This combination:
  • Automatically connects at startup
  • Blocks traffic if VPN disconnects
  • Provides maximum privacy protection
  • Ideal for privacy-conscious users

Manual VPN Control

Disable auto-connect for manual control:
This allows:
  • Manual connection when needed
  • Normal internet access by default
  • Flexibility for different usage scenarios

Selective VPN Usage

Disable auto-connect but enable lockdown mode:
Result:
  • VPN doesn’t connect automatically
  • No internet access until you manually connect
  • Prevents accidental unprotected connections

Timing and Startup Behavior

When Auto-Connect Triggers

Auto-connect activates when:
  1. System boots (if daemon starts automatically)
  2. Mullvad daemon starts or restarts
  3. Daemon recovers from a crash
Auto-connect does NOT trigger when:
  • You manually disconnect using mullvad disconnect
  • You close the Mullvad app (daemon keeps running)

Startup Sequence

With auto-connect enabled:

Interaction with Other Settings

Lockdown Mode

Auto-connect works well with lockdown mode:
Behavior:
  • At startup, lockdown mode blocks all traffic
  • Auto-connect immediately starts connecting
  • Traffic remains blocked until connected
  • No IP leaks during boot

Relay Constraints

Auto-connect uses your current relay settings:
Result: Automatically connects to Swedish relay at startup

Manual Disconnect

Manually disconnecting doesn’t disable auto-connect:

System Integration

Linux

On Linux, auto-connect works with systemd:

macOS

On macOS, auto-connect works with Launch Daemons:

Windows

On Windows, auto-connect works with Windows Services:
  • connect - Manually connect to VPN
  • disconnect - Manually disconnect from VPN
  • lockdown - Configure traffic blocking when disconnected
  • relay - Set relay constraints for auto-connect
  • status - Check connection status

Exit Status

Notes

  • Auto-connect setting is persistent across restarts
  • The setting is stored in Mullvad daemon configuration
  • Manual disconnection doesn’t disable auto-connect
  • Auto-connect respects current relay constraints
  • Works on all platforms (Linux, macOS, Windows)

Maximum Privacy

Result: Always protected, no leaks, maximum privacy

Balanced Privacy

Result: Always protected, local network accessible

Manual Control

Result: Full control, connect when needed

Troubleshooting

Auto-Connect Not Working

If VPN doesn’t connect at startup:
  1. Check auto-connect setting:
  2. Verify daemon is running:
  3. Check daemon logs for connection errors
  4. Verify you’re logged in:

Unwanted Auto-Connection

If VPN connects when you don’t want it to:

Source Reference

Implementation: mullvad-cli/src/cmds/auto_connect.rs