Note: If you prefer to control the ExpressVPN Linux app with a graphical user interface (GUI), you can do so using the ExpressVPN GUI app for Linux, or via the ExpressVPN browser extension for Chrome and Firefox.

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
Important: ExpressVPN does not officially support any distro not listed above. If your distro is based on any of the above operating systems, you can still set up and use ExpressVPN on it by following this tutorial. However, ExpressVPN will not provide fixes for any issues on these distros.

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

  1. Go to the ExpressVPN setup page. If prompted, enter your ExpressVPN credentials and click Sign In.
  2. Enter the verification code that is sent to your email.
  3. On the right, select Download Universal Installer.
  4. Click Download.
  5. Select Save File. Click OK.

Need help? Contact the ExpressVPN Support Team for immediate assistance.

Back to top


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.

Back to top


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.

Back to top


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.

Back to top


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.

Back to top


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.

Back to top


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.

Back to top


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.

Back to top


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:

  1. Open the Terminal window.
  2. Make sure to connect to the VPN and use the Automatic or Lightway protocol.
  3. 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
  4. Press Enter to confirm.

You can also enable and disable each advanced protection feature individually:

Block trackers

  1. Open the Terminal window.
  2. Make sure to connect to the VPN and use the Automatic or Lightway protocol.
  3. To block trackers, enter the command:
    expressvpnctl set blockTrackers true
    To disable, enter the command:
    expressvpnctl set blockTrackers false
  4. Press Enter to confirm.

Block malicious sites

  1. Open the Terminal window.
  2. Make sure to connect to the VPN and use the Automatic or Lightway protocol.
  3. To block malicious sites, enter the command:
    expressvpnctl set blockMalicious true
    To disable, enter the command:
    expressvpnctl set blockMalicious false
  4. Press Enter to confirm.

Block ads

  1. Open the Terminal window.
  2. Make sure to connect to the VPN and use the Automatic or Lightway protocol.
  3. To enable the ad blocker, enter the command:
    expressvpnctl set blockAds true
    To disable, enter the command:
    expressvpnctl set blockAds false
  4. Press Enter to confirm.

Block adult sites

  1. Open the Terminal window.
  2. Make sure to connect to the VPN and use the Automatic or Lightway protocol.
  3. To block adult sites, enter the command:
    expressvpnctl set blockAdult true
    To disable, enter the command:
    expressvpnctl set blockAdult false
  4. Press Enter to confirm.

Read more about ExpressVPN’s advanced protection features.

Need help? Contact the ExpressVPN Support Team for immediate assistance.

Back to top


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.

Back to top


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.

Back to top

Was this article helpful?

We're sorry to hear that. Let us know how we can improve.

A member of our Support Team will follow up on your issue.