selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

docker-ipsec-vpn-server logo

Self-host docker-ipsec-vpn-server

IPsec VPN server image for L2TP, Cisco IPsec and IKEv2

ReleaseSource AvailableOther
docker run --name ipsec-vpn-server --env-file ./vpn.env --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
Updated4 months ago
LanguageShell
Setup difficultyEasy
Stars
7 158
Ports
500 (IPsec), 4500 (IPsec)
Docker
hwdsl2/ipsec-vpn-server

What is docker-ipsec-vpn-server?

docker-ipsec-vpn-server alternatives

Should you self-host docker-ipsec-vpn-server?

docker-ipsec-vpn-server scores 64/100 on selfhost.directory (how scoring works) and ranks #17 of 56 in VPN. It has 7 158 GitHub stars, +14 in the last 30 days.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is Other-licensed and written mostly in Shell.

Its closest alternative on selfhost.directory is Tailscale (84/100, 38 805 stars). It scores higher overall, so compare the two before you pick. See docker-ipsec-vpn-server vs Tailscale side by side.

Features

  • Automatic credential and config generation
  • Configurable client DNS
  • Device provisioning profiles
  • IKEv1 XAuth (Cisco IPsec) VPN
  • IKEv2 client management script
  • IKEv2 VPN
  • IPsec/L2TP VPN
  • IPv6 support for IKEv2 clientsIKEv2 mode only
  • Multiple VPN users
  • Per-mode enable/disable
  • Persistent state via Docker volume
  • Split-tunnelingIKEv2 mode
  • Static client IP assignment
  • Unprivileged container mode

docker-ipsec-vpn-server README

English | 简体中文 | 繁體中文 | Русский

IPsec VPN Server on Docker

Build Status GitHub Stars Docker Stars Docker Pulls

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.

How to install docker-ipsec-vpn-server

Install docker-ipsec-vpn-server with Docker

Environment variables
VPN_IPSEC_PSK, VPN_USER, VPN_PASSWORD (all optional)
docker run \
    --name ipsec-vpn-server \
    --env-file ./vpn.env \
    --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

Run `docker pull hwdsl2/ipsec-vpn-server` first; the Debian-based variant uses the image name hwdsl2/ipsec-vpn-server:debian.

How to configure docker-ipsec-vpn-server

  • VPN_IPSEC_PSKIPsec pre-shared key for IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes; randomly generated if not given. A secure PSK should have at least 20 random characters.

    values: pre-shared key string

  • VPN_USERvpnuserUsername for VPN login (L2TP / XAuth modes).
  • VPN_PASSWORDPassword for VPN_USER; randomly generated if not given.
  • VPN_ADDL_USERSSpace-separated list of additional VPN usernames; all VPN users share the same IPsec PSK.
  • VPN_ADDL_PASSWORDSSpace-separated passwords matching VPN_ADDL_USERS, in the same order.

More in VPN

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…