Encrypting your internet use on Linux makes sense, but it isn’t necessarily as straightforward as on Windows, macOS, or mobile devices. Not all VPN services offer Linux clients—so what can you do?
As the most popular family of Linux distros, we’re going to look at how to install a VPN on Ubuntu. The screenshots use the main Ubuntu version (19.10), although the same steps should work (or be closely approximated) in alternative Ubuntu versions and downstream builds, such as Lubuntu and Mint.
Table of Contents
- Choosing an Ubuntu Linux VPN
- Are There Any Free VPNs for Ubuntu?
- Set up Your VPN on Ubuntu
- No VPN Client? Install OpenVPN on Linux
- How to Use OpenVPN on Linux Ubuntu
- Keep Your Activity Private: Enable Your Ubuntu VPN Client
There are many excellent VPNs that are perfect for Linux. This article uses ExpressVPN (click here for a massive discount), which is perhaps the best VPN on today’s market, particularly for those streaming Netflix.
- Ubuntu or Ubuntu-based distribution
- Ubuntu-compatible VPN
- The VPN client, downloadable from your VPN provider
Choosing an Ubuntu Linux VPN
VPN providers like to hedge their bets when it comes to Linux. While offering client apps is rare, they nevertheless support OpenVPN (OVPN), which is an open-source VPN client. But if you’re looking for a simple solution that doesn’t require you to download OpenVPN files (see below), you need a VPN service with a Linux client app.
However, it is important to note that almost all Linux VPN clients are launched from the terminal. Once installed, it’s simply a case of calling the VPN client, issuing a connect command, and specifying a server. It’s straightforward, but rarely offers the same flexibility you might enjoy on other platforms.
So, where should you start? The following VPN services offer Ubuntu-compatible Linux VPN clients:
- Mullvad VPN (our Mullvad VPN review )
- Windscribe (our Windscribe VPN review )
- ExpressVPN (click here to get 49% off)
Are There Any Free VPNs for Ubuntu?
All the above VPN services are subscription-based. But what if you need a free VPN for Ubuntu?
Options are limited. Very few (if any) free VPN providers can be trusted to do anything other than encrypt your data. But such is the low level of trust for such businesses, even that is a risk. Instead, if you just need a free Ubuntu VPN for a short period, many top VPN services offer short-term trials.
For example, ProtonVPN has no data restrictions, but you are limited to one device. The other free VPN for Ubuntu, AirVPN, is only free for a short time, but offers a longer three-day trial for just €2 (about $2.25). It should be noted, however, that AirVPN is not always available to new signups, so this option may not be available to you.
Set Up Your VPN on Ubuntu
With your VPN service selected, download the client, and set it up on Ubuntu. Setting up a VPN on Ubuntu differs depending on the specifications of the client software. It might mean downloading a DEB file, a snap file, or simply grabbing the client via the terminal from the repositories, or from GitHub.
To demonstrate, here’s how to set up ExpressVPN on Ubuntu.
With an active subscription, sign into the website, completing two-step verification. If your operating system isn’t auto detected, select See all devices and choose Linux. Here, select your distro (we’re using Ubuntu 64-bit for this demonstration) and click Download.
The DEB file will download and you’ll be prompted to open the file. Use your default software manager for this and wait as the VPN installs.
ExpressVPN, like many other Linux VPNs, runs form the command line. It still requires some setting up, however. While some VPNs will require inputting a username and password, ExpressVPN uses an authentication key. Setting up ExpressVPN on Ubuntu means launching the command prompt, then inputting the following:
When prompted, paste (or enter) the authentication string.
Use the expressvpn command to display options. You can quickly connect to a VPN server by inputting the country in the command:
expressvpn connect Germany
Alternatively, you can also input the country, location, and server number:
expressvpn connect Germany - Frankfurt -1
To disconnect, simply use:
Seems too technical? Fortunately, ExpressVPN and other VPNs offer browser plugins for Chrome and Firefox. These make using the VPN service far easier if a mouse-accessible client isn’t available for your operating system.
All Linux-friendly VPN providers offer similar command line apps, so you should find these steps a useful guide for most of them. Naturally, check the documentation for your chosen VPN service for exact steps.
No VPN Client? Install OpenVPN on Linux
What if you don’t have a VPN client available with your chosen VPN service, or you regularly switch VPNs? In this scenario, it makes sense to have a VPN-client app ready to use. Rather than installing one client after another, just use a single VPN-client app.
Fortunately, such a solution exists. You’ll need the OpenVPN client on Ubuntu Linux, which can be installed with:
sudo apt install openvpn
How to Use OpenVPN on Linux Ubuntu
So, you’ve installed the OpenVPN client on Linux. But how do you connect to a VPN server?
Start by ensuring that your VPN provider supports OpenVPN. Almost all do, but you’ll need to download the configuration file for the VPN server you wish to use. Check your VPN provider’s support pages for details—the configuration files have the OVPN file extension.
For example, a VPN server based in London might be called London-VPN.OVPN.
Using the ExpressVPN example again, the file to connect to a server in Switzerland is: my_expressvpn_switzerland_udp.ovpn. To use this with the OpenVPN client on Ubuntu Linux, input:
sudo openvpn --config my_expressvpn_switzerland_udp.ovpn
You will then be prompted for your credentials to access the VPN provider. Input these, and the VPN connection will be completed.
Keep Your Activity Private: Enable Your Ubuntu VPN Client
It’s important to remember that VPN providers regularly update their client apps and server IPs. Whether you’re using a client app or the OpenVPN app, take the time to regularly update your OVPN configurations. Do this weekly or bi-weekly to ensure you’re accessing the best servers available.
Various VPN providers offer support for Linux , although a small amount do not. Of those that do, the focus is almost always on Ubuntu, rather than other Linux distros. While the steps outlined here will work with the Ubuntu/Debian branch of Linux distributions, OpenVPN can be used with all other Linux versions.