A Docker file to build images for AMD & ARM devices with an installation of OpenVPN VPN server to secure your data communications, whether it's for Internet privacy, remote access for employees, securing IoT, or for networking Cloud data centers.
Be aware! You should carefully read the usage documentation of every tool!
| Website | GitHub | Docker Hub |
|---|---|---|
| Deft.Work my personal blog | openvpn | openvpn |
| Docker Pulls | Docker Stars | Size | Sponsors |
|---|---|---|---|
This image has been builded using buildx for these architectures:
- amd64 arm64 ppc64le s390x 386 arm/v7 arm/v6
Build for amd64 arm64 or armv7l architecture (thanks to its Multi-Arch base image)
docker build -t elswork/openvpn .The process to get a full fuctional VPN server and a suitable ovpn client file involve 6 steps:
make volumeOr
docker volume create --name ovpn-data-samplemake configOr
docker run -v ovpn-data-sample:/etc/openvpn \
--log-driver=none --rm elswork/openvpn ovpn_genconfig \
-u udp://YourServerDomain.commake pkiOr
docker run -v ovpn-data-sample:/etc/openvpn \
--log-driver=none --rm -it elswork/openvpn touch /etc/openvpn/vars
docker run -v ovpn-data-sample:/etc/openvpn \
--log-driver=none --rm -it elswork/openvpn ovpn_initpkiYou can execute earlier three steps (Create Volume, Generate Configuration and Initialize PKI) in a single make command.
make initmake startOr
docker run -v ovpn-data-sample:/etc/openvpn \
-d -p 1194:1194/udp --cap-add=NET_ADMIN elswork/openvpnmake clientOr
docker run -v ovpn-data-sample:/etc/openvpn \
--log-driver=none --rm -it elswork/openvpn easyrsa build-client-full CLIENTNAME nopassmake retrieveOr
docker run -v ovpn-data-sample:/etc/openvpn \
--log-driver=none --rm elswork/openvpn \
ovpn_getclient CLIENTNAME > CLIENTNAME.ovpnAfter this command a file called "CLIENTNAME.ovpn" should be created in the current path, this file in the client configuration file for this VPN server, it must be sent to the client device that will connect to the VPN, sometimes it can be difficult to send that file out of the linux system, I suggest to send it via mail if you have an operative mail system in your linux host or using SFTP, FTP, SCP, or Samba. Send the generated ovpn file to your smartphone or client device.
You must have installed OpenVPN Connect
Sponsor me! Together we will be unstoppable.