Overview
Themullvad 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:on- Enable automatic connection on startupoff- 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
Enable Auto-Connect
Disable Auto-Connect
Use Cases
Always-On VPN Protection
Enable auto-connect for continuous protection:- 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:- Manual connection when needed
- Normal internet access by default
- Flexibility for different usage scenarios
Selective VPN Usage
Disable auto-connect but enable lockdown mode:- 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:- System boots (if daemon starts automatically)
- Mullvad daemon starts or restarts
- Daemon recovers from a crash
- 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:- 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: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:Related Commands
- 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
| Code | Description |
|---|---|
| 0 | Setting updated successfully |
| 1 | Failed to update setting |
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)
Recommended Configurations
Maximum Privacy
Balanced Privacy
Manual Control
Troubleshooting
Auto-Connect Not Working
If VPN doesn’t connect at startup:-
Check auto-connect setting:
-
Verify daemon is running:
- Check daemon logs for connection errors
-
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