The easiest way to set up an OpenVPN server, the script is very helpful to manage the client keys
First, we need to download the script, then make it executable and run with bash
wget https://git.io/vpn -O openvpn-install.sh
chmod +x openvpn-install.sh
bash openvpn-install.sh
Following will be output and options to choose to create the VPN server and Client Certificates.
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]: rahul
OpenVPN installation is ready to begin.
Press any key to continue...
Finished!
The client configuration is available in: /root/XXXX.ovpn
New clients can be added by running this script again.
Once the client configuration is done we can copy it and move it to the device we need to use as the client. Configure the Ovpn client app with the client key and can start using the VPN.