What is OpenVPN Access Server?
OpenVPN Access Server, [a] self-hosted VPN solution, simplifies the rapid deployment of a secure remote access and site-to-site solution with a web-based administration interface and built-in OpenVPN Connect app distribution with bundled connection profiles. -https://openvpn.net/access-server/
Installing Docker
- Log into the Linux based device
- Run the following commands in the terminal
# install prerequisites
sudo apt install apt-transport-https ca-certificates git curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER
Running OpenVPN Access Server
- Now that Docker is installed, run the following commands to setup the OpenVPN Access Server Docker container and run it
# create working directory
mkdir ~/docker/openvpn-as -p
# run openvpn access server container
docker run -d --name openvpn-as --cap-add=NET_ADMIN -p 943:943 -p 8443:443 -p 1194:1194/udp -v ~/docker/openvpn-as:/openvpn openvpn/openvpn-as
# find the temporary password
docker logs openvpn-as | grep 'Auto-generated pass'
- Locate the line Auto-generated pass = and copy the password to your clipboard
- Open a web browser and navigate to https://DNSorIP:943/admin
- Login with the username openvpn and the Auto-generated password located earlier
- Click the Agree button to accept the EULA
- Click User Management > User Permissions in the left navigation
- Click the edit icon next to the openvpn user
- Enter a new password in the Password field > Click the Save Settings button
- Click Logout at the bottom of the left navigation
- Log back in with the username openvpn and the updated password
- Welcome to OpenVPN Access Server running in Docker
Source: https://openvpn.net/as-docs/docker.html