English | 简体中文 | 繁體中文 | Русский
Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2.
Based on Alpine 3.23 or Debian 12 with Libreswan (IPsec VPN software) and xl2tpd (L2TP daemon).
An IPsec VPN encrypts your network traffic, so that nobody between you and the VPN server can eavesdrop on your data as it travels via the Internet. This is especially useful when using unsecured networks, e.g. at coffee shops, airports or hotel rooms.
Features:
- Automatically generates VPN credentials and IKEv2 configuration on first start
- Supports IKEv2 with strong and fast ciphers (e.g. AES-GCM)
- Generates VPN profiles to auto-configure iOS, macOS and Android devices
- Supports Windows, macOS, iOS, Android, Chrome OS and Linux as VPN clients
- Includes a helper script to manage IKEv2 users and certificates
- Automatically built and published via GitHub Actions
- Persistent data via a Docker volume
- Multi-arch:
linux/amd64,linux/arm64,linux/arm/v7
Also available:
- VPN: IPsec without Docker, WireGuard, OpenVPN, Headscale
- AI: Self-Hosted AI Stack for local LLMs, chat, RAG, voice and AI tools
📘 Interested in self-hosted AI? The Self-Hosted AI Builder’s Guide is a practical guide to building, securing, and operating your own private AI stack.
Use this command to set up an IPsec VPN server on Docker:
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-serverYour VPN login details will be randomly generated. See Retrieve VPN login details.
Alternatively, you may set up IPsec VPN without Docker. To learn more about how to use this image, read the sections below.
- 📬 Get project updates and free deployment guides (1–2 emails/month)
- 💬 Join the r/selfhostedstack community for discussions
- ⭐ Star the repository if you find it useful — it helps others discover it