How to Install OpenVPN on your Ubuntu or Debian Server or PC
Knowledgebase/cloud/how-to-install-openvpn-on-ubuntu-or-debian-server

OpenVPN is the most popular open-sourced VPN or virtual-private-network library available and can be used for any task to your liking, here's how to install it on your Ubuntu or Debian Server in a few easy steps!
Install the OpenVPN application onto your OS
In this article, we'll be using a fantastic installation script for OpenVPN created by Nyr, to start you will have to access your server's bash shell through SSH or optionally using the VNC viewer located in your dashboard.
Firstly, run the following command to download the installation script to your file system:
wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh -O openvpn-install.sh
Now you should always verify that scripts you download from the internet are safe and won't harm your system. It's generally a bad idea to run arbitrary software from the internet and so, at the very least, we should make it a habit to inspect it before running. Do this with the nano
command which will open the NANO text editor, as shown below, or alternatively with your editor of choice (e.g. vim).
nano openvpn-install.sh
Alas we begin the installation process itself by running these two commands:
First run: sudo chmod +x openvpn-install.sh
Then: sudo bash openvpn-install.sh
After such, your console screen will be greeted with the 'OpenVPN road warrior installer', which looks something like this:
Welcome to this OpenVPN road warrior installer!
Which protocol should OpenVPN use?
1) UDP (recommended)
2) TCP
Protocol [1]: 1
What port should OpenVPN listen to?
Port [1194]:
Select a DNS server for the clients:
1) Current system resolvers
2) Google
3) 1.1.1.1
4) OpenDNS
5) Quad9
6) AdGuard
DNS server [1]: 2
Enter a name for the first client:
Name [client]: iphone
OpenVPN installation is ready to begin.
Press any key to continue...
In Protocol put 1, Port: any will do, we recommend 1194 as it's the default one, choose a DNS resolver that fits (Google works almost always) and finally a name for the device, then press any key to continue on with the install.
You are all done with the installation process! Now we've come to the networking sector, for this we will be using the KUBBUR Cloud Management Interface on a KUBBUR VPS Server which makes it 10x easier to configure networking rules.
All that you need to do is go to your firewall manager like so:

Then select "NEW RULE"

And fill in: Name can be anything you want (OpenVPN port for example), Source IP is the IP that is allowed to connect to the port (you can restrict this to your own IP for example, leave blank for no restriction), Destination IP should be the IP of your Virtual Server and Protocol is set to 'UDP', Source Port to as previously noted whatever you want to restrict it to (leave blank for no restrictions) and the Destination Port to whichever port you chose as your OpenVPN port in the installation process (we recommended 1194), and Action is set to "ALLOW".
After creating the rule, you might want to maximize the DDoS mitigation potential of your OpenVPN install so go back to the "Firewall" section and click on "Filters".

Press "Add filter" under the "OpenVPN UDP server" section and set the Destination IP to the IP of where OpenVPN is pointed to (by default this is your server's default IP address, which is only important if you have multiple IP addresses), then set the port field to 1194 or whichever port you chose in the OpenVPN installation and that's it!
Note: the rules & firewall may take 10-15 minutes to apply.
You're all done, you've installed OpenVPN Server-side on your Ubuntu or Debian Install!