English | 简体中文 | 繁體中文 | 日本語 | Русский
Set up your own IPsec VPN server in just a few minutes, with IPsec/L2TP, Cisco IPsec and IKEv2.
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.
We will use Libreswan as the IPsec server, and xl2tpd as the L2TP provider.
Features:
- Fully automated IPsec VPN server setup, no user input needed
- 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 helper scripts to manage VPN users and certificates
Also available:
- Docker VPN: IPsec VPN, 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.
Start with a Linux server* running a supported operating system.
Use this one-liner to set up an IPsec VPN server:
wget https://get.vpnsetup.net -O vpn.sh && sudo sh vpn.shYour VPN login details will be randomly generated, and displayed when finished.
Tip: Optionally install WireGuard, OpenVPN and/or Headscale on the same server.
See the script in action (terminal recording).
Note: This recording is for demo purposes only. VPN credentials in this recording are NOT valid.
Click here if you are unable to download.
You may also use curl to download:
curl -fsSL https://get.vpnsetup.net -o vpn.sh && sudo sh vpn.shAlternative setup URLs:
https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/vpnsetup.sh
https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.shIf you are unable to download, open vpnsetup.sh, then click the Raw