docker-ipsec-vpn-server
by hwdsl2
A lightweight Docker image to deploy a secure IPsec VPN server supporting IPsec/L2TP, Cisco IPsec, and IKEv2 protocols.
Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Primary Use Case
This tool enables users to quickly set up a VPN server in a Docker container to encrypt network traffic and secure connections over untrusted networks such as public Wi-Fi. It is ideal for system administrators or privacy-conscious users who want to establish their own VPN infrastructure without complex manual setup. The VPN supports multiple client platforms including Windows, macOS, iOS, Android, Chrome OS, and Linux.
- Supports IKEv2 with strong and fast ciphers like AES-GCM
- Supports IPsec/L2TP and Cisco IPsec protocols
- Generates VPN profiles for automatic configuration on iOS, macOS, and Android
- Compatible with Windows, macOS, iOS, Android, Chrome OS, and Linux clients
- Includes helper scripts to manage IKEv2 users and certificates
- Available as a lightweight Alpine-based Docker image (~18 MB) and a Debian-based image (~62 MB)
- Supports multiple CPU architectures: linux/amd64, linux/arm64, linux/arm/v7
Installation
- Install Docker on your Linux server following official Docker documentation
- Optionally, install Podman and create an alias for docker if preferred
- Pull the trusted Docker image from Docker Hub: docker pull hwdsl2/ipsec-vpn-server
- Alternatively, pull from Quay.io and tag the image accordingly
- Run the container with the provided docker run command to start the VPN server
Usage
>_ docker run \
--name ipsec-vpn-server \
--restart=always \
-v ikev2-vpn-data:/etc/ipsec.d \
-v /lib/modules:/lib/modules:ro \
-p 500:500/udp \
-p 4500:4500/udp \
-d --privileged \
hwdsl2/ipsec-vpn-serverStarts the IPsec VPN server container with persistent storage, required ports exposed, and necessary privileges.
>_ docker pull hwdsl2/ipsec-vpn-serverDownloads the latest official IPsec VPN server Docker image from Docker Hub.
>_ docker pull quay.io/hwdsl2/ipsec-vpn-serverDownloads the IPsec VPN server image from Quay.io as an alternative registry.
>_ docker image tag quay.io/hwdsl2/ipsec-vpn-server hwdsl2/ipsec-vpn-serverTags the Quay.io image with the Docker Hub image name for consistency.
>_ docker restart ipsec-vpn-serverRestarts the VPN server container, sometimes required on macOS before using IPsec/L2TP mode.
- Deploy as a secure VPN gateway to protect remote access and reduce attack surface.
- Integrate with centralized certificate management for scalable user authentication.
- Use in purple team exercises to simulate secure channel establishment and test detection of encrypted tunnels.
- Combine with network monitoring tools to detect anomalous VPN usage patterns.
- Leverage Docker containerization for rapid deployment and consistent environment setup across teams.
Docs Take 2 Hours. AI Takes 10 Seconds.
Ask anything about docker-ipsec-vpn-server. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.
3 free chats per tool • Instant responses • No credit card
Related Tools

v2ray-core
v2fly/v2ray-core
A platform for building proxies to bypass network restrictions.

sniffnet
GyulyVGC/sniffnet
Comfortably monitor your Internet traffic 🕵️♂️
algo
trailofbits/algo
Set up a personal VPN in the cloud
setup-ipsec-vpn
hwdsl2/setup-ipsec-vpn
Scripts to build your own IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
cilium
cilium/cilium
eBPF-based Networking, Security, and Observability
netbird
netbirdio/netbird
Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
