Follow this guide to use the Mullvad command line interface (CLI) in the Terminal (Linux, macOS) or Command Prompt (Windows).
For more commands, see also the guide CLI commands for using WireGuard.
If the Mullvad app isn't up to date, first download the latest version and install it.
What this guide covers
- Basic commands
- More commands
- - Split tunneling (Linux)
- - Split tunneling (Windows)
- - Block options
- - Use custom DNS server
- - Use bridge mode
- - Report a problem
- - Reset settings
Open a terminal window and type
mullvad to see a full list of subcommands and their usages. Below is a list of the most common ones.
Set your account
Replace the number string with your Mullvad account number.
mullvad account login 1234123412341234
mullvad account to see a list of other account-related commands.
Show account info
This command will show your account number, device name and the expiration date of your account.
mullvad account get
List device names in the account
mullvad account list-devices
List server locations
This command displays a list of available countries and cities.
mullvad relay list
Select a location
In this example, we are connecting to a server in Sweden (se), in the city of Malmö (mma).
Replace "se" with the country of your choice and, optionally, "mma" with a specific city in that country.
mullvad relay set location se mma
Select a specific server
Replace "se" with the country of your choice and, optionally, "mma" with a specific city in that country and "se-mma-001" with a servername in this group.
mullvad relay set location se mma se-mma-001
Or use this command.
mullvad relay set hostname se-mma-001
Connect to the location that you selected.
Force an update of the server location list
mullvad relay update
Check your connection status
To see more details use this command.
mullvad status -v
Use OpenVPN over TCP:
This can help if you are not able to connect with WireGuard or OpenVPN over UDP.
mullvad relay set tunnel-protocol openvpn mullvad relay set tunnel openvpn --protocol tcp
Auto-connect on start-up
If you want Mullvad to start and connect when you boot up your computer, use this command.
mullvad auto-connect set on
To turn this off, run
mullvad auto-connect set off
Enable LAN access
mullvad lan set allow
Split tunneling (Linux)
Split tunneling allows you to exclude some apps from the VPN so they will use your regular Internet connection. This will for example allow you to access some websites that are blocking VPN services.
To start a new process excluded from Mullvad use this command.
Example: run a connection check outside of the VPN tunnel.
mullvad-exclude curl https://am.i.mullvad.net/connected
Using mullvad split-tunnel
This command works with the PID (process ID) of a program. To find the PID of a running program use the
pgrep Linux command.
To exclude a process from Mullvad that is already running use this command.
mullvad split-tunnel pid add <pid>
To list the PIDs of all the processes that are currently excluded use this command.
mullvad split-tunnel pid list
To restore a previously excluded process use this command.
mullvad split-tunnel pid delete <pid>
To restore all previously excluded processes use this command.
mullvad split-tunnel pid clear
Split tunneling (Windows)
Check if Split tunneling is enabled or disabled:
mullvad split-tunnel get
Enable split tunneling:
mullvad split-tunnel set on
Disable split tunneling:
mullvad split-tunnel set off
List currently running excluded processes and their PIDs:
mullvad split-tunnel pid list
List excluded apps:
mullvad split-tunnel app list
Remove all excluded apps:
mullvad split-tunnel app clear
Exclude an app:
mullvad split-tunnel app add "C:\Program Files\Mozilla Firefox\firefox.exe"
Remove an excluded app:
mullvad split-tunnel app remove "C:\Program Files\Mozilla Firefox\firefox.exe"
Block options (ads / trackers / malware / gambling / adult content)
To enable DNS filtering of ads, trackers and/or malware you can use the following commands.
To view the help, use this command.
mullvad dns set default --help
To enable all DNS filters use the following command.
mullvad dns set default --block-ads --block-malware --block-trackers --block-gambling --block-adult-content
To reset the filtering use this command.
mullvad dns set default
Use custom DNS server
If you set a custom DNS server it will override "Block ads / trackers / malware". You can only use a public DNS server if you use WireGuard protocol, however you can use a local DNS server with OpenVPN protocol.
To set a custom DNS server use the following command and replace 220.127.116.11 with the server IP you want to use.
mullvad dns set custom 18.104.22.168
To reset the DNS use this command.
mullvad dns set default
Use bridge mode
To enable Bridge mode (Shadowsocks with OpenVPN) use the following command.
mullvad bridge set state on
To select a specific bridge server use this command.
mullvad bridge set location se mma se-mma-br-001
To set the location back to automatic use this command.
mullvad bridge set location any
To set Bridge mode back to automatic use this command.
mullvad bridge set state auto
Report a problem
First create an anonymized log file.
mullvad-problem-report collect --output report.log
Before sending it to us, you have the option to view the log file.
Then send the log file.
mullvad-problem-report send --report report.log --email firstname.lastname@example.org --message "Write a description of your problem."
Although optional, we strongly recommend that you include a description of the problem. You also don't need to fill in an email address, but if you want a reply from us, you will need to include one.
This command performs a factory reset on all settings, deletes app logs and cache files, disconnects the app, and logs you out.
You will be asked to confirm your decision before the reset.