This tutorial will show you how to set up the ExpressVPN app for Linux via the command line interface (CLI).
ExpressVPN is compatible with these 64-bit Linux operating systems:
- Ubuntu: 20.04 and above
- Debian: 10 and above
- Fedora: 38 and above
- Arch: Latest rolling release
- Raspberry Pi (armhf): Pi OS 10 and above
- Mint: Linux Mint 20 and above
Prefer manual setup? See the instructions for manual setup for OpenVPN (via the Terminal) and OpenVPN (via Ubuntu Network Manager).
Jump to…
Download the installer
Install and activate the app
Connect to a VPN server location
Disconnect from a VPN server location
Choose a different VPN server location
Switch to a different VPN protocol
View all commands
Split tunneling
Block ads, trackers, and harmful sites
Network lock
Uninstall the app
Download the installer
- Go to the ExpressVPN setup page. If prompted, enter your ExpressVPN credentials and click Sign In.
- Enter the verification code that is sent to your email.
- On the right, select Download Universal Installer.
- Click Download.
- Select Save File. Click OK.
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Install and activate the app
Install the app
Go to your Downloads folder. Locate and double-click the installer file you downloaded earlier. A Terminal window will open and ask you to input your device password to complete the installation.
Activate the app
Open a new Terminal. Run this command:
expressvpnctl login xvtokenfile
Paste the activation code you found earlier. Note the code won’t appear on the screen. Press Enter.
You can help improve ExpressVPN by sharing anonymized diagnostic reports. Enter Y to accept or n to decline.
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Connect to a VPN server location
Note: To use connection commands in the CLI, either the ExpressVPN GUI client must be running, or background mode must be enabled by running the command: expressvpnctl background enable
To connect to the VPN, run this command:
expressvpnctl connect
If you are connecting for the first time, ExpressVPN will use the Smart Location feature to select a server location, which is recommended to you based on factors such as speed and proximity.
If this is not your first time connecting, ExpressVPN will connect to the server location you most recently connected to.
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Disconnect from a VPN server location
To disconnect from a server location, run this command:
expressvpnctl disconnect
ExpressVPN will disconnect from the server it is connected to.
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Connect to a different VPN server location
To find a list of locations to connect to, enter the following command in the terminal:
expressvpnctl get region
Connect to a specific VPN server location
To connect to a specific server location, enter:
expressvpnctl connect "[LOCATION]"
For example, to connect to Germany – Frankfurt – 1, enter:
expressvpnctl connect "Germany - Frankfurt - 1"
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Switch to a different VPN protocol
Important: Disconnect from the VPN before switching to another protocol.
VPN protocols are the methods by which your device connects to a VPN server. For the best experience, ExpressVPN recommends using the Automatic protocol option. This is selected by default and automatically picks the protocol most appropriate for your network.
In some cases, switching to a different protocol can give you faster connection speeds.
To switch to Lightway – TCP, run the following command:
expressvpnctl protocol lightwaytcp
To switch to Lightway – UDP, run the following command:
expressvpnctl protocol lightwayudp
To switch to OpenVPN – TCP, run the following command:
expressvpnctl protocol openvpntcp
To switch to OpenVPN – UDP, run the following command:
expressvpnctl protocol openvpnudp
To use the Automatic option, run this command:
expressvpnctl protocol auto
Need help? Contact the ExpressVPN Support Team for immediate assistance.
View all commands
To view a list of the app’s functions and commands, run this in the terminal:
expressvpnctl -h
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Split tunneling
Split tunneling enables you to choose which apps use the VPN and which apps don’t when you are connected to ExpressVPN. This allows you to access both local and blocked content on your Linux device.
To enable split tunneling, run the command:
expressvpnctl set splittunnel true
Once enabled, you can decide which apps bypass the VPN and which apps use the VPN.
To add apps you wish to bypass the VPN, run the command:
expressvpnctl set split-app bypass[ROUTE TO FOLDER WHERE THE APP IS LOCATED]
For example, if you wanted the VPN to bypass Firefox, you would run the command:
expressvpnctl set split-app bypass:/usr/lib/firefox/firefox
To add apps you wish to use the VPN, run the command:
expressvpnctl set split-app vpn[ROUTE TO FOLDER WHERE THE APP IS LOCATED]
For example, if you wanted the VPN to bypass Firefox, you would run the command:
expressvpnctl set split-app vpn:/usr/lib/firefox/firefox
To delete split tunneling rules for an app, run the command:
expressvpnctl set split-app remove[ROUTE TO FOLDER WHERE THE APP IS LOCATED]
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Block ads, trackers, and harmful sites
Customize your online experience and take back control over what companies know about you. You can block ads, trackers, malicious sites, and adult content from within the ExpressVPN app.
A lot of the apps and websites you visit keep a record of and share your activity with third-party companies, including trackers, scammers, and malware sites. This information is used to serve you more targeted ads and content, usually without your knowledge or permission.
These advanced protection features prevent all apps and websites you visit on your device from communicating with the third-party companies in our open-source blocklists.
Advanced protection features are disabled by default. To enable all advanced protection features at the same time:
- Open the Terminal window.
- Make sure to connect to the VPN and use the Automatic or Lightway protocol.
- To enable all advanced protection features, enter the command:
expressvpnctl set blockAll true
To disable all advanced protection features, enter the command:
expressvpnctl set blockAll false
- Press Enter to confirm.
You can also enable and disable each advanced protection feature individually:
Block trackers
- Open the Terminal window.
- Make sure to connect to the VPN and use the Automatic or Lightway protocol.
- To block trackers, enter the command:
expressvpnctl set blockTrackers true
To disable, enter the command:
expressvpnctl set blockTrackers false
- Press Enter to confirm.
Block malicious sites
- Open the Terminal window.
- Make sure to connect to the VPN and use the Automatic or Lightway protocol.
- To block malicious sites, enter the command:
expressvpnctl set blockMalicious true
To disable, enter the command:
expressvpnctl set blockMalicious false
- Press Enter to confirm.
Block ads
- Open the Terminal window.
- Make sure to connect to the VPN and use the Automatic or Lightway protocol.
- To enable the ad blocker, enter the command:
expressvpnctl set blockAds true
To disable, enter the command:
expressvpnctl set blockAds false
- Press Enter to confirm.
Block adult sites
- Open the Terminal window.
- Make sure to connect to the VPN and use the Automatic or Lightway protocol.
- To block adult sites, enter the command:
expressvpnctl set blockAdult true
To disable, enter the command:
expressvpnctl set blockAdult false
- Press Enter to confirm.
Read more about ExpressVPN’s advanced protection features.
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Network lock
ExpressVPN has a Network Lock that acts as a kill switch. If your connection gets interrupted accidentally, Network Lock will immediately stop all internet traffic from entering or leaving your device. This prevents your online traffic from being exposed during the interruption.
Network Lock in enabled by default. To disable Network Lock, run the command:
expressvpnctl set networklock false
To re-enable Network Lock, run the command:
expressvpnctl set networklock true
Need help? Contact the ExpressVPN Support Team for immediate assistance.
Uninstall the app
To uninstall the app, locate the app installation file and run the command:
expressvpn-uninstall.sh
Need help? Contact the ExpressVPN Support Team for immediate assistance.