How to Install OpenVPN Server and Client on Ubuntu 20.04

In modern society, the Internet is all over the place as a public utility. When somebody moves into a new apartment, or a business organization moves into a new space, the Internet is the primary utility on the list to be requested, followed by handling trash, providing heat, power, and telephone service. With programs such as One PC per Child, so-called third-world countries have the internet where there’s no running water, sewers, or any telephone services. This wide-reaching service is the reason that at a certain point it will be essential to secure the information transmitted on the network.

There is a wicked sector of people that are looking to take the advantage of the heavy concentrations of crowd and people. Advanced technology lets these people intercept messages, read, modify, send them along their way easily. Virtual Private Networks (VPNs) were created to secure communication over the unprotected infrastructure. Nowadays, the network landscapes are exceptionally different. Not only the governments and military, indeed many nontechnical users are aware of the security need for their connections. Enterprises want to maintain the integrity of the information and security to protect their consumers.

Every day, most individuals utilize VPN according to their requirements. Numerous VPN technologies exist for both open-source projects and commercial vendors. OpenVPN is one of the most popular virtual private networks in this series.

Features of OpenVPN

  • OpenVPN is highly customizable.
  • The configuration is easy as compared to other VPN alternatives for example IPsec based protocols.
  • It can also authenticate users by utilizing the MySQL database credentials data.
  • OpenVPN uses TCP or UDP protocols.

 That’s all about OpenVPN Now, let’s start the installation guide of setting up OpenVPN Server and Client on Ubuntu 20.04 but first make sure that you are logged in as a ‘superuser‘.

1. Installing OpenVPN Server on Ubuntu 20.04

Step 1: Open the terminal by pressing ‘CTRL+ALT+T’ or search it manually in the activities and update the packages list.

$ sudo apt-get update

Step 2: Execute any of these commands to figure out the public IP address of your server.

$ wget -qO - icanhazip.com
$  dig +short myip.opendns.com @resolver1.opendns.com

Step 3: Utilize the curl command to download the server installation script.

$ curl -O https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh

Step 4: Modify the script permissions and turn it to an executable file. After that, execute the file on the terminal.

$ chmod +x openvpn-install.sh
$ sudo bash openvpn-install.sh

Enter ‘y’ to enable the IPv6 support and answer the upcoming questions according to your requirement.

Step 5: Setup the Client name for OpenVPN.

Step 6: Check the status of OpenVPN and use the ‘ss’ command to confirm that OpenVPN is listening on the allocated port.

$  sudo systemctl status openvpn
$ sudo ss -tupln | grep openvpn

Step 7: A new VPN tunnel interface should be created. Verify its presence by writing-out the following command.

$ ip add

2. Installing OpenVPN Client on Ubuntu 20.04:

Step 1: Utilize the given command for installing OpenVPN Client.

$ sudo apt install openvpn

Step 2: You also need a GUI to configure the VPN settings. For that, we will install the network-manager package.

$  sudo apt install network-manager-openvpn

Step 3: Now start, enable and check the status of OpenVPN.

$ sudo systemctl start openvpn 
$ sudo systemctl enable openvpn 
$  sudo systemctl status openvpn 

Step 4: Open the Network settings on your system and under the ‘VPN’ menu click on ‘+’ to add a private network.

Step 5: Import the configuration settings that you settled and stored in a file.

Step 6: From the right side, click on ‘Add’ and connect the client to the OpenVPN Server.

Step 7: Again check the network interfaces. There should be a new VPN tunnel as highlighted in the output.

$ ip add

Conclusion:

In this article, we have discussed how nowadays it is necessary to have a VPN on your system. We have also learned new features about OpenVPN. In the second part of the article, a step by step guide is given for OpenVPN Server and OpenServer Client on Ubuntu 20.04.

Free Newsletter
Join our Newsletter and get the latest Linux news and tips
in your inbox for FREE.