How to Install OpenVPN on Ubuntu 18.04 Bionic Beaver

Install OpenVPN on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure OpenVPN on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Virtual private network technology makes possible to access safe, private networks by using less secure networks like the internet. VPNs are typically used to connect physically remote branches of an organization, making them appear as if they were part of the same LAN (for example two offices in different cities). The traffic between the sides of the connection is encrypted using tunnels, which protects the transmitted data and the connection information themselves. For the same characteristics, VPNs are often used to circumvent government restrictions and anonymize internet traffic.

Install OpenVPN on Ubuntu 18.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Installing OpenVPN on Ubuntu.

Now clone the openvpn-install repository using git:

Next, change to the directory openvpn-install created by clone and run the installer script:

You will get a couple of prompts to change or confirm default settings for the installation:

If the installation was successful, you should get a success message at the end:

Main OpenVPN server configuration file is, /etc/openvpn/server.conf you are free to tune and tweak it to your liking:

Step 3. Generate OpenVPN user profile.

We need to generate VPN Profiles to be used by the users. The same script we used for the installation will be used for this:

From the output you can confirm the location of my profile,/root/ramona.ovpn you need to copy this profile to the user. The location of the associated private key is also provided /etc/openvpn/easy-rsa/pki/private/ramona.key.bmwe46.

Step 4. Connect to OpenVPN Server from the client.

Finally steps, You can use the VPN client of your choice to configure OpenVPN client on your operating system. For those who want to use Official OpenVPN client, go to the downloads page and get the latest release then install it.

That’s all you need to do to install OpenVPN on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.