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
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.
This image requires running with --privileged mode and access to /lib/modules for kernel module support. It does not support Docker for Windows but works on Linux and macOS (with Docker for Mac). Users should secure their VPN credentials and consider persistent volume usage to retain configuration and certificates. Advanced users can build the image from source for customization.
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
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-server
Starts the IPsec VPN server container with persistent storage, required ports exposed, and necessary privileges.
docker pull hwdsl2/ipsec-vpn-server
Downloads the latest official IPsec VPN server Docker image from Docker Hub.
docker pull quay.io/hwdsl2/ipsec-vpn-server
Downloads the IPsec VPN server image from Quay.io as an alternative registry.
docker image tag quay.io/hwdsl2/ipsec-vpn-server hwdsl2/ipsec-vpn-server
Tags the Quay.io image with the Docker Hub image name for consistency.
docker restart ipsec-vpn-server
Restarts the VPN server container, sometimes required on macOS before using IPsec/L2TP mode.