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`.
शामिल सर्विसेज़
openvpn
kylemanna/openvpn:latest
एनवायरनमेंट वेरिएबल्स:
जनरेटेड 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
त्वरित जानकारी
- सर्विसेज़
- 1
- नेटवर्क्स
- 1
- वॉल्यूम्स
- 1
कब उपयोग करें
यह टेम्पलेट एक openvpn एनवायरनमेंट सेटअप के लिए आदर्श है। सभी सर्विसेज़ healthchecks, रिसोर्स लिमिट्स और उचित डिफ़ॉल्ट सेटिंग्स के साथ पहले से कॉन्फ़िगर्ड हैं। प्रोडक्शन में डिप्लॉय करने से पहले एनवायरनमेंट वेरिएबल्स कस्टमाइज़ करें।
सुझाव
- डिप्लॉय करने से पहले सभी डिफ़ॉल्ट पासवर्ड बदलें
- अपने हार्डवेयर के अनुसार रिसोर्स लिमिट्स की समीक्षा करें
- प्रोडक्शन HTTPS के लिए रिवर्स प्रॉक्सी जोड़ें
- डेटा वॉल्यूम्स के लिए बैकअप रणनीतियाँ कॉन्फ़िगर करें