hwdsl2/docker-openvpn is a security-focused project on GitHub with 37 stars, written primarily in Shell. Docker image to run an OpenVPN server with automatic PKI setup and client config generation. Managed via a helper script. Based on Alpine Linux with OpenVPN and EasyRSA. Supports amd64, arm64 and arm/v7.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
AI: Self-Hosted AI Stack for local LLMs, chat, RAG, voice and AI tools
📘 Interested in self-hosted AI? The Self-Hosted AI Builder’s Guide (Kindle · Google Play · paperback) is a practical guide to building, securing, and operating your own private AI stack.
Import client.ovpn into your OpenVPN client to connect.
Alternatively, you may set up OpenVPN without Docker. To learn more about how to use this image, read the sections below.
Community
📬 Get project updates and free deployment guides (1–2 emails/month)
💬 Join the r/selfhostedstack community for discussions
⭐ Star the repository if you find it useful — it helps others discover it
Requirements
A Linux server with a public IP address or DNS name
Docker installed
VPN port open in your firewall (UDP 1194 by default, or your configured port/protocol)
Download
Get the trusted build from the Docker Hub registry:
docker pull hwdsl2/openvpn-server
Alternatively, you may download from Quay.io:
docker pull quay.io/hwdsl2/openvpn-server
docker image tag quay.io/hwdsl2/openvpn-server hwdsl2/openvpn-server
Supported platforms: linux/amd64, linux/arm64 and linux/arm/v7.
Environment variables
All variables are optional. If not set, secure defaults are used automatically.
This Docker image uses the following variables, that can be declared in an env file (see example):
Variable
Description
Default
VPN_DNS_NAME
Fully qualified domain name (FQDN) of the server
Auto-detected public IP
VPN_PUBLIC_IP
Public IPv4 address of the server
Auto-detected
VPN_PUBLIC_IP6
Public IPv6 address of the server
Auto-detected
VPN_PROTO
VPN protocol: udp or tcp
udp
VPN_PORT
VPN port (1–65535)
1194
VPN_CLIENT_NAME
Name of the first client config generated
client
VPN_DNS_SRV1
Primary DNS server pushed to clients
8.8.8.8
VPN_DNS_SRV2
Secondary DNS server pushed to clients
8.8.4.4
VPN_DISABLE_USAGE_COUNTS
Set to 1 to disable anonymous aggregate usage counts.
(not set)
Note: In your env file, you may enclose values in single quotes, e.g. VAR='value'. Do not add spaces around =. If you change VPN_PORT or VPN_PROTO, update the -p flag in the docker run command accordingly.
The env file is bind-mounted into the container, so changes are picked up on every restart without recreating the container.
Client management
Use docker exec to manage clients with the ovpn_manage helper script.
Add a new client:
docker exec openvpn ovpn_manage --addclient alice
docker cp openvpn:/etc/openvpn/clients/alice.ovpn .
Export a client config (prints to stdout):
docker exec openvpn ovpn_manage --exportclient alice > alice.ovpn
List clients:
docker exec openvpn ovpn_manage --listclients
Revoke a client (will prompt for confirmation):
docker exec -it openvpn ovpn_manage --revokeclient alice
# Or revoke without confirmation prompt:
docker exec openvpn ovpn_manage --revokeclient alice -y
Persistent data
All server and client data is stored in the Docker volume (/etc/openvpn inside the container):
/etc/openvpn/
├── server/
│ ├── server.conf # OpenVPN server configuration
│ ├── ca.crt # CA certificate
│ ├── server.crt # Server certificate
│ ├── server.key # Server private key
│ ├── tc.key # TLS crypt key
│ ├── dh.pem # DH parameters
│ ├── crl.pem # Certificate revocation list
│ ├── client-common.txt # Client config template
│ ├── ipp.txt # IP pool persistence
│ └── easy-rsa/pki/ # Full PKI directory
└── clients/
├── client.ovpn # First client config
└── alice.ovpn # Additional clients
Back up the Docker volume to preserve all keys and client configurations.
IPv6 support
If the Docker host has a public (global unicast) IPv6 address and the requirements below are met, IPv6 support is automatically enabled when the container starts. No manual configuration is needed.
Requirements:
The Docker host must have a routable global unicast IPv6 address (starting with 2 or 3). Link-local (fe80::/10) addresses are not sufficient.
IPv6 must be enabled for the Docker container. See Enable IPv6 support in Docker.
To enable IPv6 for the Docker container, first enable IPv6 in the Docker daemon by adding the following to /etc/docker/daemon.json on the Docker host, then restart Docker:
{
"ipv6": true,
"fixed-cidr-v6": "fddd:1::/64"
}
After that, re-create the Docker container. To verify that IPv6 is working, connect to the VPN and check your IPv6 address, e.g. using test-ipv6.com.
Using docker-compose
cp vpn.env.example vpn.env
# Edit vpn.env if needed, then:
docker compose up -d
docker cp openvpn:/etc/openvpn/clients/client.ovpn .
To update the Docker image and container, first download the latest version:
docker pull hwdsl2/openvpn-server
If the Docker image is already up to date, you should see:
Status: Image is up to date for hwdsl2/openvpn-server:latest
Otherwise, it will download the latest version. Remove and re-create the container using instructions from Quick start. Your data is preserved in the openvpn-data volume.
Usage counts
This image uses public GitHub release asset download counts for anonymous, aggregate usage counts. Counts are approximate and are not unique users or active installs. The image does not send a telemetry payload or use a private collector. It only attempts the best-effort count after setup reaches OpenVPN startup with a mounted /etc/openvpn volume, and again when that persistent install first runs a different image build. To opt out, set VPN_DISABLE_USAGE_COUNTS=1.
Technical details
Base image: alpine:3.23
OpenVPN: latest available from Alpine packages
EasyRSA: bundled at build time
Cipher: AES-128-GCM
Auth: SHA256
Key exchange: tls-crypt (HMAC + encrypt)
DH parameters: pre-defined ffdhe2048 group (RFC 7919)
Client certificates: 10-year validity
VPN subnet: 10.8.0.0/24
IPv6 VPN subnet: fddd:1194:1194:1194::/64 (when server has IPv6)
Further reading
📚 For broader guidance on protecting your online privacy, see Privacy Tools in the Age of AI.
License
Note: The software components inside the pre-built image (such as OpenVPN and EasyRSA) are under the respective licenses chosen by their respective copyright holders. As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
Copyright (C) 2026 Lin Song
This work is licensed under the MIT License.
This project is based in part on the work of Nyr and contributors, licensed under the MIT License.
How active is development on hwdsl2/docker-openvpn?
The most recent commit recorded on hwdsl2/docker-openvpn was 13 days ago, based on the GitHub push timestamp. The repository has 8 forks — one of the better signals of community interest.
How does hwdsl2/docker-openvpn compare to other Security projects?
hwdsl2/docker-openvpn is tracked by TopGit in the Security category, with 37 GitHub stars and written in Shell. Browse the Security topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does hwdsl2/docker-openvpn have?
hwdsl2/docker-openvpn has 37 GitHub stars — refresh the page for the live number, or check github.com/hwdsl2/docker-openvpn. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is hwdsl2/docker-openvpn open source?
TopGit's metadata for hwdsl2/docker-openvpn does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is hwdsl2/docker-openvpn?
hwdsl2/docker-openvpn (hwdsl2/docker-openvpn) is a Shell project on GitHub. From the project's own README: Docker image to run an OpenVPN server with automatic PKI setup and client config generation. Managed via a helper script. Based on Alpine Linux with OpenVPN and EasyRSA. Supports amd64, arm64 and arm/v7.
Where do I read more about hwdsl2/docker-openvpn?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/hwdsl2/docker-openvpn is the definitive source.
Read full README in the tab above.
Is docker-openvpn worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of docker-openvpn.