Follow these instructions to use the Mullvad command line interface (CLI) in your operating system's terminal.
If you haven't already, first download the Mullvad VPN app and install it.
In order for your terminal/console to find the mullvad CLI binary, the Mullvad VPN app resource directory must be present in the PATH environment variable, which is where your OS searches for binaries.
C:\Program Files\Mullvad VPN\resources\
The Mullvad VPN CLI is added to a system wide PATH directory by default, so nothing has to be done here.
These are the various commands available to you.
Replace the number string with your Mullvad account number.
mullvad account set 1234123412341234
This command will show your account number and the expiration date of your account.
mullvad account get
This command displays a list of available countries and cities.
mullvad relay list
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
Connect to the location that you selected.
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
mullvad lan set allow