How to set up Linux OpenVPN

linux-devices

Need a VPN for Linux?

Get ExpressVPN Now
refer a friend

Love ExpressVPN? Want a free month?

Refer a friend now

This guide will show you how to manually set up ExpressVPN on Linux using the Terminal. You will be establishing a Linux OpenVPN connection via Terminal, using ExpressVPN’s configuration files.

Prefer app setupSee the instructions for setting up the ExpressVPN app for Linux.

Jump to…

Download the OpenVPN configuration files
Install and set up the VPN
Connect to the VPN server location
Disconnect from the VPN server location


Download the OpenVPN configuration files

Open the Welcome Email you received when you signed up for ExpressVPN. Click the link in the email.

ExpressVPN Sign-in screen with Sign In button highlighted.

If you cannot find the link, sign in to your account here.

sign in to your expressvpn account

Once you have clicked the link in the welcome email or signed in to the website, click on Set Up on More Devices.

Click on Manual Config on the left side of the screen and then select the OpenVPN tab on the right. You will first see your username and password and then a list of OpenVPN configuration files.

Find the server location(s) you want to connect to (for example, Los Angeles, New York, Hong Kong), then download and save the .ovpn file(s) to your desktop.

Note: Please have your username and password ready, as you will be asked to enter them later in the setup process.

ExpressVPN setup screen with Username, Password, and Configuration files highlighted.

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

Back to top


Install and set up the VPN

For installation instructions, click on the version of Linux you use below:

Ubuntu 14.04

If you are using Ubuntu 14.04, enter the following commands.

For installation:

sudo apt-get install network-manager network-manager-openvpn network-manager-openvpn-gnome openvpn easy-rsa

For configuring OpenVPN:

sudo openvpn --config

Next, drag and drop the .ovpn file you wish to use from the desktop into the Terminal window. Terminal will automatically capture the path for you.

Diagram showing how to drag the .ovpn file to the Terminal window.

Ubuntu 16.04 or 16.10

If you are using Ubuntu 16.04 or 16.10, enter the following commands.

For installation:

sudo apt-get install -y openvpn

For configuring OpenVPN:

sudo openvpn --up /etc/openvpn/update-resolv-conf --down /etc/openvpn/update-resolv-conf --script-security 2 --config

Next, press the space bar once and drag the .ovpn file you wish to use from the desktop into the Terminal window. Terminal will automatically capture the path for you.

Diagram showing how to drag the .ovpn file to the Terminal window.

Other versions of Linux

If you are using a different version of Linux, enter the following commands.

For installation:

sudo apt-get install -y openvpn

For configuring OpenVPN:

sudo openvpn --config

Next, drag and drop the .ovpn file you wish to use from the desktop into the Terminal window. Terminal will automatically capture the path for you.

Diagram showing how to drag the .ovpn file to the Terminal window.

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

Back to top


Connect to the VPN server location

To connect OpenVPN, once the path is loaded, press Enter to initiate connection to the server.

Wait for the connection sequence to finish. Once the connection has been established successfully, you should see something like the screenshot below (Initialization Sequence Completed).

Terminal screenshot showing Initialization Sequence Completed.

Note: For the VPN to be active, the Terminal window must stay active/open. It can be minimized—just do not close it!

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

Back to top


Disconnect from the VPN server location

To disconnect, press Ctrl + C on the Terminal window to quit/exit the program.

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

Back to top

Was this article helpful?60 37 Undo