OpenVPN
OpenVPN is one of the most widely deployed open-source VPN solutions, providing secure point-to-point or site-to-site connections. This stack uses the kylemanna/openvpn Docker image, which bundles OpenVPN with EasyRSA for certificate management and a streamlined initialization process. Data is persisted in a named volume mounted at /etc/openvpn, ensuring your PKI, server configuration, and client certificates survive container restarts. The container runs with NET_ADMIN capability required for tunnel interface creation and uses UDP port 1194 for optimal VPN performance. After deployment, run `docker compose run --rm openvpn ovpn_genconfig -u udp://YOUR_SERVER_IP` and `docker compose run --rm openvpn ovpn_initpki` to initialize, then generate client configs with `docker compose run --rm openvpn easyrsa build-client-full CLIENT_NAME nopass`.
Included Services
openvpn
kylemanna/openvpn:latest
Environment Variables:
Generated YAML
# Generated by ComposeHub (composehub.dev)
name: openvpn
services:
openvpn:
image: kylemanna/openvpn:latest
restart: always
ports:
- 1194:1194/udp
volumes:
- openvpn_data:/etc/openvpn
environment:
OVPN_SERVER_URL: ${OVPN_SERVER_URL:-udp://localhost}
OVPN_DATA: /etc/openvpn
networks:
- openvpn
healthcheck:
test:
- CMD-SHELL
- pgrep openvpn || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
deploy:
resources:
limits:
cpus: "1.00"
memory: 256M
reservations:
cpus: "0.10"
memory: 64M
labels:
com.composehub.description: OpenVPN server with EasyRSA certificate management
cap_add:
- NET_ADMIN
networks:
openvpn:
driver: bridge
volumes:
openvpn_data:
driver: local
Quick Info
- Services
- 1
- Networks
- 1
- Volumes
- 1
When to Use
This template is ideal for setting up a openvpn environment. All services are pre-configured with healthchecks, resource limits, and sensible defaults. Customize environment variables before deploying to production.
Tips
- Change all default passwords before deploying
- Review resource limits for your hardware
- Add a reverse proxy for production HTTPS
- Configure backup strategies for data volumes