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`.
Servizi Inclusi
openvpn
kylemanna/openvpn:latest
Variabili d'Ambiente:
YAML Generato
# 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
Informazioni Rapide
- Servizi
- 1
- Reti
- 1
- Volumi
- 1
Quando Usarlo
Questo template è ideale per configurare un ambiente openvpn Tutti i servizi sono preconfigurati con healthchecks, limiti di risorse e valori predefiniti sensati. Personalizza le variabili d'ambiente prima di fare il deploy in produzione.
Consigli
- Cambia tutte le password predefinite prima del deploy
- Verifica i limiti di risorse per il tuo hardware
- Aggiungi un reverse proxy per HTTPS in produzione
- Configura strategie di backup per i volumi di dati