Whether you want to hide your identity from prying eyes or access content blocked by geo-restrictions, running an OpenVPN server is an excellent solution to run your own VPN server.
- A VPS with Ubuntu 20.04
Step 1: Downloading OpenVPN Server and configuring it
Run the following command to install OpenVPN Server:
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
The following prompts should appear, follow the instructions on screen or below:
If your server is assigned multiple IPs, it will show in this prompt, your main IP should be the first one.
Which IPv4 address should be used?1) 22.214.171.124
IPv4 address : 1
In most cases, you’ll want to select UDP here as it is a quicker protocol but if you know that UDP is blocked, you can select TCP.
Which protocol should OpenVPN use?1) UDP (recommended)
Protocol : 1
The default port of 1194 should be fine in most cases but if you know that it is blocked, you can use another port such as 443.
What port should OpenVPN listen to?Port : 1194
This option will let you set your DNS servers, this is completely up to you, if you want AdBlocking, use AdGuard but 126.96.36.199 is the DNS server we recommend.
Select a DNS server for the clients:1) Current system resolvers
6) AdGuardDNS server : 3
This option will let you set the client for your VPN, if you will be the only person using your VPN, you can leave this as client.
Enter a name for the first client:Name [client]: client
You’re now ready to begin installing OpenVPN server, press ENTER to install.
OpenVPN installation is ready to begin.Press any key to continue...
Your OpenVPN profile should now be available at /root/client.ovpn, you can now use this file for your OpenVPN client and connect to your server!
Credit to: https://github.com/Nyr/openvpn-install for the script used in this tutorial.