- Quick and easy VPN setup using OpenVPN Docker image, on Amazon Linux 2023.
dnf update -y
dnf install docker -y
systemctl enable docker
systemctl start docker
# see: https://openvpn.net/as-docs/docker.html#run-the-docker-container
docker pull openvpn/openvpn-as
docker run -d \
--name=openvpn-as --cap-add=NET_ADMIN \
-p 943:943 -p 4443:4443 -p 1194:1194/udp \
-v /root/openvpn-server:/openvpn \
openvpn/openvpn-as
# Modify ports and hostname as appropriate
cd /root/openvpn-server/etc
vim ./config-local.json
docker restart openvpn/openvpn-as
# Get Temp password
docker logs openvpn-as | grep -i "Auto-generated pass"
# Scroll to find the line, Auto-generated pass = "<password>". Setting in db..\
- Use the generated password with the
openvpn
username to sign in to the Admin Web UI. - https://<my_hostname_or_pubip>.com:943/admin/
- Check the hostname setting:
https://<my_hostname_or_pubip>.com:943/admin/network_settings
- put in yourhostname...
- Stop the VPN services and start to ensure changes loaded and persistent:
- https://<my_hostname_or_pubip>.com:943/admin/status_overview
- Create a user and a new Token Url for the user to import the profile
-
Install with winget:
winget install -e --id OpenVPNTechnologies.OpenVPNConnect
- Requires admin privileges
-
Once installed, get the token which will be something like:
openvpn://https://<hostname>:<adminport>/ConnectClient/<token>.ovpn
-
Put in browser and should open up the OpenVPN client and import the profile, and connect.
- https://ifconfig.io/
- curl ifconfig.io