The below outlines the process for installing OpenVPN on Ubuntu 22 server.
apt update -y && apt upgrade -y
Up next we will add the packages and the gpg key for OpenVPN. These details are retrieved from the official OpenVPN page : https://as-portal.openvpn.com/get-access-server/ubuntu
wget https://as-repository.openvpn.net/as-repo-public.asc -qO /etc/apt/trusted.gpg.d/as-repository.asc
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/as-repository.asc] http://as-repository.openvpn.net/as/debian jammy main">/etc/apt/sources.list.d/openvpn-as-repo.list
Once the repositories are added, we can go ahead and install the server along with its requirements.
apt update && apt -y install openvpn-as ca-certificates net-tools gnupg
As soon as the install is finished, you will have an output which will contain the URL for the server and the admin credentials. It is important to take note of these in order to administer the server.