OpenVPN server in a Docker container complete with an EasyRSA PKI CA.
229
OpenVPN server in a Docker container complete with an EasyRSA PKI CA.
Copy from kylemanna/openvpn
Pick a name for the $OVPN_DATA data volume container. It's recommended to use the ovpn-data- prefix to operate seamlessly with the reference systemd service. Users are encourage to replace example with a descriptive name of their choosing.
OVPN_DATA="ovpn-data-example"
Initialize the $OVPN_DATA container that will hold the configuration files and certificates. The container will prompt for a passphrase to protect the private key used by the newly generated certificate authority.
docker volume create --name $OVPN_DATA
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm folkmancer/openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COM
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it folkmancer/openvpn ovpn_initpki
Start OpenVPN server process
docker run -d -p 1194:1194/udp --name=openvpn --restart=always -v $OVPN_DATA:/etc/openvpn --cap-add=NET_ADMIN folkmancer/openvpn:latest
Generate a client certificate without a passphrase
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it folkmancer/openvpn easyrsa build-client-full CLIENTNAME nopass
Retrieve the client configuration with embedded certificates
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm folkmancer/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn
Content type
Image
Digest
Size
5.8 MB
Last updated
about 7 years ago
docker pull folkmancer/openvpn