How to Set Up a VPN on Linux

It's common for VPNs to refrain from making a Linux app, but you're not without options. You can still use a VPN on Linux if the provider supplies manual setup instructions.


The majority of the top VPNs favor the Windows operating system, so your favorite VPN might not offer an app for Linux. However, as long as you've been given setup details from your provider, you can get it running by setting up the VPN manually using OpenVPN or PPTP.

OpenVPN Setup

Some Linux distributions support OpenVPN by default, in which case you can import the configuration file into the Network settings. Here's how to do it in Ubuntu 19.10 (and likely other versions):

  1. Open Settings.
  2. Choose Network on the left.
  3. Select the plus sign in the VPN section to the right.
Ubuntu network settings screen
Ubuntu network settings
  1. Select Import from file and then open the configuration file you downloaded from your VPN provider.
Ubuntu Add VPN screen
Ubuntu 'Add VPN' screen
  1. Most of the necessary details will be imported into the correct fields. You just need to edit the name (if you want) and enter the right username and password that will let you onto that server.
  2. Select Add at the top.
ExpressVPN server details entered into the Ubuntu Add VPN screen
Ubuntu VPN settings

To enable or disable the connection, return to step 2 and toggle the VPN on or off.

If those steps aren't working for you, OpenVPN has detailed directions on how to install and use their software on Linux, so we won't repost them here. If you're using Ubuntu or Debian, there's a step where you'll need to know the release name of the distribution. To get it, enter this into a separate terminal:

cat /etc/*-release

PPTP Setup

This is a little more involved than the OpenVPN method, but still very straightforward. Here's how the whole setup procedure looks in Ubuntu 19.10:

  1. Open Settings.
  2. Select Network from the left pane.
  3. Select the plus sign next to VPN.
Ubuntu network settings screen
Ubuntu network settings
  1. Choose Point-to-Point Tunneling Protocol (PPTP).
Ubuntu Add VPN screen
Ubuntu 'Add VPN' screen
  1. Enter the server into the Gateway field.
  2. Type the username and password that's needed to authenticate with that server. To enable the password field, you might need to press the button next to it and choose one of the Store the password options. You can also change the name so that you'll know what you're connecting to later.
ExpressVPN server details and credentials entered into Ubuntu
Ubuntu PPTP VPN details
  1. Select Advanced and enable Use Point-to-Point encryption (MPPE) and Allow stateful encryption.

Note that this step is required by ExpressVPN, which we're using here as an example. Other providers might have you do something different here.

PPTP Advanced Options screen on Ubuntu
Ubuntu PPTP advanced settings
  1. Choose OK and then Add.

Enable or disable the VPN by returning to step 2 and selecting the button next to the connection.