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.

Requirements

  • A VPS with Ubuntu 20.04
Get a VPS at rawSRV.com starting at $9.50/m!

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) 176.23.44.234
2) 172.17.0.1
3) 172.18.0.1
IPv4 address [1]: 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)
2) TCP
Protocol [1]: 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]: 1194

This option will let you set your DNS servers, this is completely up to you, if you want AdBlocking, use AdGuard but 1.1.1.1 is the DNS server we recommend.

Select a DNS server for the clients:1) Current system resolvers
2) Google
3) 1.1.1.1
4) OpenDNS
5) Quad9
6) AdGuardDNS server [1]: 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.