Sign inSign up

gurgui/ovpn

By gurgui

Updated about 1 year ago

Light OpenVPN server built on alpine

Image
Networking
Security
0

288

gurgui/ovpn repository overview

OpenVPN Alpine container

Container repo can be found at DockerHub

How to use

A docker volume/local mountpoint must be mounted into /etc/openvpn/config containing 1 or more OpenVPN server configuration files - server config template. However, as long as you don't set CREATE_TEST_PKI to false, you don't need to create/bring your own config file since it will be created on first run using gpkih.

  • Create a volume
docker volume create ovpn
  • Create a container, PKI will be created upon first run
docker run --name ovpn \
    -it \
    -v ovpn:/etc/openvpn/config \
    --privileged \
    -p 1194:1194/udp \
    -e MAX_VPN_INSTANCES=1 \
    gurgui/ovpn:latest

The default profile generated with gpkih will also generate a client inline configuration which can be found at /root/test/packs/CL/inline_CL.conf.

The only thing left to do is change the client remote with the server's IP and PORT (you can also leave this to the container by setting the env variable VPN_CLIENT_REMOTE with the desired value, e.g "10.10.10.10 1194") and you'll have a ready-to-use client file. Import it in your OpenVPN Connect Client and securely connect to the server.

Environment variables

KeywordValueDefaultDescription
MAX_VPN_INSTANCESunsigned integer2Limits the maximum amount of instances to be ran
CREATE_TEST_PKIbooleantrueCreates a test PKI using gpkih on first run
VPN_CLIENT_REMOTEtext""Sets the clients' vpn remote property

Notes

I don't know yet why using --cap-add=NET_ADMIN and avoiding --privileged keeps giving me a permission error(1) when trying to run the openvpn --config <server.conf> as root within the container

Tag summary

Content type

Image

Digest

sha256:ac6ba8927

Size

9.9 MB

Last updated

about 1 year ago

docker pull gurgui/ovpn