Installing VPN on Linux (2024)

You want to install a VPN on Linux right? We will show you how to install VPN in this article. But before we get started on the steps, let’s start with some background info to make sure you have the context.

With the rise of digital era, the world has undergone some fascinating technological changes. Moving on from landlines to mobile phones and then to smartphones, the world has reached a new horizon and it keeps on growing and growing. However, this growth hasn’t come without any repercussions. Data privacy is also at risk, and your data could be potentially accessed.

This is where we start to ask our self “How do we protect our data?” Choosing your Operating System should be your first step when defending your personal data. A popular choice by many users today would be Windows. But this popularity of Windows has itself proven to be a problem, as it has become a massive playing field for malware. A more reliable and secure alternative would be Linux, as it being open-source allows anyone to read and comment out on its code and thus there are much fewer vulnerabilities, bugs and threats to look out for. However, Linux itself isn’t flawless. It still further needs some extra resources to provide better security. One of these is a virtual private network (VPN), a private controlled network that secures your computer’s internet connection by ensuring that all data that you’re sending or receiving is encrypted which makes it difficult for anyone from the outside to eavesdrop on what you’re doing.

Using OpenVPN to Install VPN on Linux

OpenVPN is an open-source VPN protocol that itself is not a VPN provider but rather acts as a bridge between the VPN software and the VPN server. Using this, we will be able to install VPN on Linux. Let us go through the steps now.

Step 1: Checking to see which version of Ubuntu you have

Since there are 32 bit and 64 bit flavors of VPN Softwares available, the first thing you’ll want to do before getting started is checking to see which version of Ubuntu you’re currently using. To do this, first open the Terminal through either Ubuntu Dash or Ctrl+Alt+T shortcut. Once the Terminal is opened, enter the following command:

$ lscpu

The CPU op-mode(s) entry tells you which bit version of Ubuntu you’re currently running.

Step 2: Updating System Apt Cache and Packages

Next we want to update our system’s apt cache and packages to the latest versions so that no issues arise during installation. This can be done by running the following commands:

$ sudo apt-get update
$ sudo apt-get upgrade

Step 3: Installation of OpenVPN

In most Linux distros, OpenVPN is already installed. But it is better to verify this beforehand. Enter the following command to do this:

$ sudo apt-get install openvpn

If OpenVPN is already installed in your desktop, you’d be presented with something like this:

Step 4: Installation of Network Manager Packages

The easiest way to set up and install VPN in Linux is through the Network Manager. It basically is a mandatory package that allows us to import and use the OpenVPN Config files. Installation of this package can be done by the following commands:

$ sudo apt install network-manager-openvpn network-manager-openvpn-gnome

Step 5: Download the OpenVPN Configurations

Now you have to select your VPN service that you’ll be using to set up VPN on your Linux distro. It is important to note that you have to select the OpenVPN configuration files of your VPN service for the set up. To get your OpenVPN configurations, you have to sign in to your VPN account and check in the Linux support or OpenVPN support slot (different for all VPN Services). The files you’d get would be in a Zip Archive. For efficient running of our VPN, it would be better to create a separate directory for it. To do this, enter in the terminal:

$ mkdir filename

filename here refers to the name of your directory. For example, in my case, it was:

Next we have to enter into this directory that we just created. To do this, we have to enter the command:

$ cd ~/filename

Again filename here refers to your directory name that you created before. Something like this:

Since our file is in a Zip format, we have to first unzip to access it. This can be done by entering the following command:

$ unzip filename.zip

filename.zip here refers to the zipped file that you downloaded. This will look like this:

Step 5: Setting up the VPN

Now finally we will be using the Network Manager to set up our VPN Connection.

For Ubuntu 18.04 and 19.10 Users:

First of all, close the Terminal and click on the Network icon in the top right of the screen as shown below. Now click on Wired Connected and choose Wired Settings.

From here, you’d be directed to Settings and the Network tab will automatically open. Find the VPN heading, and click the plus sign icon (+) next to it.

You’d be greeted with the Add VPN window. Choose Import from file.

Now we have to import the OpenVPN config file of the VPN server that we want to connect to. This can be done by browsing to the directory where we unpacked the zipped config file that we downloaded before. Click on the file and select Open.

All the OpenVPN settings from that config file will be imported. Now you just have to input your Username and Password of your VPN Service and hit Save.

The VPN Connection has been added to your Network Manager now. You can now click on the Network icon in the top right of the screen and be able connect or disconnect the VPN from your home screen.

For Ubuntu 16.04 and early version Users:

Similarly, close the Terminal and click on the connection symbol icon in the top right of the screen as shown below and select Edit Connections.

In the Network Connections, click on Add.

This is will then lead you to a prompt asking you to choose a Connection Type. Choose the Import a saved VPN configuration option in the drop-down menu and click Create.

Now we have to import the OpenVPN config file of the VPN server that we want to connect to. This can be done by browsing to the directory where we unpacked the zipped config file that we downloaded before. Click on the file and select Open.

All the OpenVPN settings from that config file will be imported. Now you just have to input your Username and Password of your VPN Service and hit Save.

The VPN Connection has been added to your Network Connections now.

You can now click on your connection symbol icon in the top right of the screen, select VPN Connections and then click on the name of your VPN Server that you want to connect to. You should get this after a successful connection:

Conclusion

With the encryption provided by a VPN you can feel confident your communications and data are fairly safe.

As an enthusiast and expert in the field of cybersecurity and privacy, I've been deeply involved in exploring and implementing measures to safeguard digital data. My experience spans a range of topics, including the installation and configuration of VPNs on various operating systems, with a particular focus on Linux.

Now, let's delve into the concepts discussed in the article about installing a VPN on Linux:

1. The Importance of Data Privacy

The article rightly emphasizes the significance of data privacy in the digital era. The evolution from landlines to smartphones has brought about tremendous technological changes, but it has also exposed users to potential risks of data breaches and unauthorized access.

2. Choice of Operating System: Linux vs. Windows

The article suggests that Linux is a more reliable and secure alternative to Windows due to its open-source nature. The ability for anyone to scrutinize and comment on the code contributes to fewer vulnerabilities, bugs, and threats. This sets the stage for the subsequent discussion on enhancing Linux security with a VPN.

3. Introduction to Virtual Private Network (VPN)

The concept of a VPN is introduced as a crucial tool for securing internet connections. It's highlighted as a private controlled network that encrypts data transmissions, making it challenging for external entities to eavesdrop on user activities.

4. OpenVPN as an Open-Source VPN Protocol

The article recommends using OpenVPN, an open-source VPN protocol, for installing a VPN on Linux. OpenVPN is portrayed as a bridge between the VPN software and the VPN server, offering a secure connection for data transmission.

5. Step-by-Step Guide for Installing VPN on Linux

The article provides a detailed guide, broken down into steps, for installing a VPN on Linux using OpenVPN. Key steps include checking the Ubuntu version, updating system packages, installing OpenVPN, installing Network Manager packages, downloading OpenVPN configurations, and finally, setting up the VPN using the Network Manager.

6. Configuring VPN Connection on Linux

The guide covers specific instructions for configuring the VPN connection using the Network Manager, tailored for different Ubuntu versions (18.04 and 19.10, as well as 16.04 and earlier versions). The importance of inputting the correct VPN server configurations and user credentials is emphasized.

7. Conclusion on VPN Usage for Enhanced Security

The article concludes by emphasizing the encryption provided by a VPN as a means to confidently secure communications and data.

In summary, the article serves as a comprehensive guide for individuals seeking to enhance their data privacy on Linux systems through the installation of a VPN, with a focus on the OpenVPN protocol.

Installing VPN on Linux (2024)
Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6484

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.