How to Stand Up an OpenVPN Docker Container
The following is the process I've used to stand up an OpenVPN docker container image. This will allow you to connect in to your home network and access local resources as if you were on your local wifi network. The original docker image and container installation documentation can be found on the original documentation on the KyleManna GitHub site here.
Linux
## Create an OVPN home directory area for profiles:
$ cd ~
$ mkdir -v OVPN_PROFILES
$ cd /home/main/OVPN_PROFILES
# Create a Docker volume to contain the VPN docker data
# (Change the year to the current year):
$ OVPN_DATA="ovpn-data-2026"
# Paste the following commands into the terminal (replace the DOMAIN_NAME with your own port-forwarded address):
$ docker volume create --name $OVPN_DATA
$ docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://DOMAIN_NAME
$ docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
## Start the server process up again:
$ docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn
## Create a new Client file (within the container) and replace the "REPLACEWITHNAME" below (recommend something like NAME202607):
$ docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full REPLACEWITHNAME nopass
## Retrieve the newly created package files:
$ docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient REPLACEWITHNAME > REPLACEWITHNAME.ovpn
## check for the newly extracted client files:
$ ls -l
## you should see some .OVPN files. You'll need to export them back to your PC. To get your username, and IP address of your current PC:
$ last | head -1
## Now pull them into your current PC, where you can put them into a gDrive to import on your phone:
$ scp *.ovpn username@YOURIPADDRESS
