In this tutorial, we will explain How to install OpenVPN on Ubuntu.

OpenVPN is open-source commercial software that implements virtual private network (VPN) techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators(NATs) and firewalls.


You will need:

  • VPS running Ubuntu

Step 1 – Download installer

To install OpenVPN on Ubuntu download the installation script.

curl -O

After, make it executable:


Step 2 – Run it.

After downloading, run it by following this command:


Now you need to answer some questions. In IP address question just hit enter.

After, you need to choose if you want to enable IPv6. Y for yes N for no.

Now select what do you want OpenVPN to listen to? Enter 1 for default.

Now choose which protocol do you want OpenVPN to use?

After, choose the DNS resolvers.

If you want to use compression type y but is not recommended.

Type n if you don’t want to customize encryption settings.

Now its time to setup OpenVPN server, press any key to continue.

Wait few minutes until your OpenVPN server is setuped. And after type client name:

Now select if you want password for the client:

Step 3 – Connect

The .ovpn file has been automatically generated and its saved on /root directory.

Import it and use by running in prefered OpenVPN client.

You have successfully installed OpenVPN on Ubuntu.

Enjoy it.