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 | Web Manager | Web Manager Repo |
|---|---|---|---|---|
| Deft.Work personal blog | openvpn | openvpn | openvpn.deft.work | openvpn.deft.work |
| 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/openvpnYou have two options for web management:
For a modern glassmorphic dashboard with real-time telemetry, QR code configuration for smartphones, certificate creation/revocation (Easy-RSA v3), and live connection monitoring:
- Live URL: https://openvpn.deft.work
- Repository: elswork/openvpn.deft.work
To deploy the OpenVPN server together with this web dashboard:
git clone https://github.com/elswork/openvpn.deft.work.git
cd openvpn.deft.work
cp .env.example .env
docker compose up -dAccess the dashboard at https://openvpn.deft.work or http://localhost:5066.
Alternatively, you can use the bundled docker-compose.yml which deploys flant/ovpn-admin alongside your server:
make compose-startOr
docker compose up -dThe web interface will be accessible at http://localhost:8080.
To stop the services:
make compose-stopOr
docker compose downmake 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.