Ubuntu 20.04 LTS Set Up OpenVPN Server In 5 Minutes

Originally published at: https://www.cyberciti.biz/faq/ubuntu-20-04-lts-set-up-openvpn-server-in-5-minutes/

I am a new Ubuntu Linux 20.04 LTS server system administrator. How can I set up an OpenVPN Server on an Ubuntu Linux version 20.04 LTS server to shield my browsing activity from bad guys on public Wi-Fi, encrypt all traffic while connecting to 4G LTE network, and more?

Hi there. You mention suggesting using 1.1.1.1 or Google DNS for speed and availability, but I would challenge that. I would suggest you consider OpenDNS as a preferred choice. There has been 100% uptime since inception in 2006 as well as the fastest in most or in top 3 in speed of response time from any country in the world. If you would like more details about this, Iā€™d be happy to share added info with you. And oh by the way, OpenDNS is backed by the best security research group on the industry and OpenDNS gives you the ability to block traffic to known malicious domains and certain categories of sites if you choose.

1 Like

Being new to this forum Iā€™m not sure Iā€™m adding to this topic correctly.

After running the install script and starting the service sudo systemctl status openvpn@server indicated failure and sudo journalctl -xe indicated the startup could not find server.conf.

/lib/systemd/system/openvpn@.service suggested it was looking in /etc/openvpn:
ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/%i.conf --writepid /run/openvpn/%i.pid.

In my installation there are client/ and server/ directories in /etc/openvpn and server.conf is under server/.

Adding the server subdirectory in ExecStart [...] to form --cd /etc/openvpn/server and --config /etc/openvpn/server/%i.conf led to an error-free start and clean-looking status:

$ sudo systemctl status openvpn@server
ā— openvpn@server.service - OpenVPN connection to server
     Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2020-05-09 06:20:38 EDT; 12h ago
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
   Main PID: 137066 (openvpn)
     Status: "Initialization Sequence Completed"
      Tasks: 1 (limit: 18706)
     Memory: 1.7M
     CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
             ā””ā”€137066 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn/server --script-security 2 --config /etc/openvpn/server/s[...]
2 Likes

@flathat66, I will look into script again and see if it creating wrong file.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki