Linux VPN | Ubuntu tutorial: How to setup a VPN Linux

Today I’m going to manually install a VPN on Linux. In this guide I’ll show you how to create a VPN on Ubuntu Linux 13.10 (Saucy Salamander). While it might be slightly different for other distributions or older versions of Ubuntu from the one described below, it should remain quite similar. To get the best protection/speed ratio, I decided to use the OpenVPN protocol which is optimal. And I’ll show you how to install two different Linux VPN service providers: IPVanish and ExpressVPN.

Tutorial to install IPVanish manually on Linux

Prerequisites

Before reading further, you should make sure you have these ready:

  • A subscription to a Linux VPNIPVanish or ExpressVPN
  • A computer running Ubuntu 13.10 (Saucy Salamander)

IPVanish has been in the VPN market for over 15 years now. It’s widely renown for its extreme secure connection (NAT Firewall included in all packages), its high speed (most gamers choose this VPN to play online), and its simplicity of use! For more details, read my IPVanish review. So let’s install IPVanish on Ubuntu.

You’ll see a bunch of files with .ovpn extensions. Each of these files represents a server in a specific city you can connect to. While ipvanish-CA-Toronto-tor-a01.ovpn is the firt IPVanish server in Toronto, ipvanish-CH-Zurich-zur-c11.ovpn is the 11th server in Zurich. So choose the server you want and save it on your desktop. In this article, I’ll use IPVanish New York City server.

how to setup a vpn linux

2

Open the Terminal and type in the command below:

sudo apt-get install network-manager-openvpn openvpn

Then press Enter. As a result, you’ll be asked to type in your system password. So type it in and press Enter. Next the system will resolve all dependencies and download all packages related to OpenVPN. And you just have to press Enter or “Y” (for yes) every time the Terminal requires you to.

3

In the network menu, go to VPN Connections and click on Configure VPN…

vpn for ubuntu

4

In the Network Connections window, click on Add.

best vpn for linux

5

In the pop up window, select Import a saved VPN configuration…

vpn linux

6

Then click Create.

vpn for linux

7

In the new window, locate the .ovpn file you previously saved on your desktop. And click on Open.

ubuntu vpn

8

In the next window, you have to setup the VPN connection

Therefore, stay in the first tab, the VPN tab. And insert the server address in the Gateway field. Then in the Authentication section, fill in your IPVanish username and password in the corresponding fields. Then click on Save…

vpn ubuntu

9

You’re almost there! Now you just need to connect to the VPN connection.

In the network menu (the same one you opened at stage 3), go to VPN Connections and click on the server you just setup. In my case, the NYC server.

openvpn linux

Ubuntu may ask you to re-insert your IPVanish password. So type it in and click OK.

openvpn ubuntu

That’s it! Everything should work properly. And you should see a notification like the one below.

ubuntu openvpn

Finally, you can check your VPN connection with IPVanish CheckIP page. While it’s a bit more of a hassle, it’s relatively easy to setup a VPN Linux. And you can install all the servers you plan to use only once. Also you can switch server in the network menu, by clicking on another server.

Another Linux VPN: How to install ExpressVPN on Linux?

Are you an advanced user? Because if you’re an advanced user, ExpressVPN will be a great choice for you. Indeed, it’s one of the oldest and most popular VPN available on the market. And it’s one of my favorites. Why? First it offers a high speed, second it covers a wide range of countries and third the VPN apps are user-friendly and available on most platforms. For more details, read my ExpressVPN review.

However, today we’ll not use an app, but the Ubuntu Terminal to install ExpressVPN. While manually setting up a VPN on linux is considered difficult, it’s not really the case. Indeed, it’s just different from Windows, you need to type commands in the Terminal. So in this tutorial, I’ll only use the Terminal to configure ExpressVPN using the OpenVPN protocol.

1

Log in the ExpressVPN website, using your ExpressVPN email address and password.

linux vpn server

2

In your account, in My Subscriptions, click on the green button Set Up ExpressVPN under Download and Install.

ubuntu vpn server

3

In the new pop up window from your browser, click on Manual Config.

vpn server linux

4

Get your login details (username and password) for the client. And download the configuration files.

This credentials are different from your account username/password. Copy the new and unique username and password to a text file. Because we will need them later in the process.

vpn client linux

On the same page, you’ll also find different configuration files. Same as above: each file is for a different server location you can connect to (for example Denver, USA). Click on the location you want and save the .ovpn file on your desktop.

5

Open the Terminal and type in the command below:

sudo apt-get install -y openvpn

Then press Enter. As a result, the system will resolve all dependencies and download all packages related to OpenVPN on your device.

6

Once installation is finished, type the command below in the Terminal:

sudo openvpn --config

Drag and drop the .ovpn file from your desktop into the Terminal window. And the Terminal will automatically capture the correct path for you. Finally press Enter.

ubuntu vpn client

This will start the Linux VPN service and the Linux VPN connection. While you’ll see different lines in the Terminal window, you shouldn’t panic! Indeed, it’s normal, even if looks like you’re in the Matrix. If the connection has been established successfully, you should see something like the screenshot below. With the Terminal showing that the Initialization Sequence is Completed.

vpn server ubuntu

7

Don’t close the terminal window!

Indeed, for the Linux VPN connection to be active, the Terminal window must stay open. It can be minimized — just don’t close it! Now you can freely browse the internet with the ExpressVPN service.

This was my guide: Linux VPN | Ubuntu tutorial: How to setup a VPN Linux. Stay tuned for more articles coming soon.

We will be happy to hear your thoughts

Leave a reply

The Best VPN for UK