[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2157":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},2157,"algo","trailofbits\u002Falgo","trailofbits","Set up a personal VPN in the cloud","https:\u002F\u002Fblog.trailofbits.com\u002F2016\u002F12\u002F12\u002Fmeet-algo-the-vpn-that-works\u002F",null,"Python",30275,2358,430,67,0,4,19,51,20,45,"GNU Affero General Public License v3.0",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37],"ansible","encryption","ikev2","ipsec","security","ssh-tunnel","strongswan","vpn","vpn-client","vpn-server","wireguard","2026-06-12 02:00:38","# Algo VPN\n\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Ftwitter.com\u002Ffold_left.svg?style=social&label=Follow%20%40AlgoVPN)](https:\u002F\u002Fx.com\u002FAlgoVPN)\n\nAlgo VPN is a set of Ansible scripts that simplify the setup of a personal WireGuard and IPsec VPN. It uses the most secure defaults available and works with common cloud providers.\n\nSee our [release announcement](https:\u002F\u002Fblog.trailofbits.com\u002F2016\u002F12\u002F12\u002Fmeet-algo-the-vpn-that-works\u002F) for more information.\n\n## Features\n\n* Supports only IKEv2 with strong crypto (AES-GCM, SHA2, and P-256) for iOS, MacOS, and Linux\n* Supports [WireGuard](https:\u002F\u002Fwww.wireguard.com\u002F) for all of the above, in addition to Android and Windows 11\n* Generates .conf files and QR codes for iOS, macOS, Android, and Windows WireGuard clients\n* Generates Apple profiles to auto-configure iOS and macOS devices for IPsec - no client software required\n* Includes helper scripts to add, remove, and manage users\n* Blocks ads with a local DNS resolver (optional)\n* Sets up limited SSH users for tunneling traffic (optional)\n* Privacy-focused with minimal logging, automatic log rotation, and configurable privacy enhancements\n* Based on Ubuntu 22.04 LTS with automatic security updates\n* Installs to DigitalOcean, Amazon Lightsail, Amazon EC2, Vultr, Microsoft Azure, Google Compute Engine, Scaleway, OpenStack, CloudStack, Hetzner Cloud, Linode, or [your own Ubuntu server (for advanced users)](docs\u002Fdeploy-to-ubuntu.md)\n\n## Anti-features\n\n* Does not support legacy cipher suites or protocols like L2TP, IKEv1, or RSA\n* Does not install Tor, OpenVPN, or other risky servers\n* Does not depend on the security of [TLS](https:\u002F\u002Ftools.ietf.org\u002Fhtml\u002Frfc7457)\n* Does not claim to provide anonymity or censorship avoidance\n* Does not claim to protect you from the [FSB](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFederal_Security_Service), [MSS](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMinistry_of_State_Security_(China)), [DGSE](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDirectorate-General_for_External_Security), or [FSM](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFlying_Spaghetti_Monster)\n\n## Deploy the Algo Server\n\nThe easiest way to get an Algo server running is to run it on your local system or from [Google Cloud Shell](docs\u002Fdeploy-from-cloudshell.md) and let it set up a _new_ virtual machine in the cloud for you.\n\n1. **Setup an account on a cloud hosting provider.** Algo supports [DigitalOcean](https:\u002F\u002Fm.do.co\u002Fc\u002F4d7f4ff9cfe4) (most user friendly), [Amazon Lightsail](https:\u002F\u002Faws.amazon.com\u002Flightsail\u002F), [Amazon EC2](https:\u002F\u002Faws.amazon.com\u002F), [Vultr](https:\u002F\u002Fwww.vultr.com\u002F), [Microsoft Azure](https:\u002F\u002Fazure.microsoft.com\u002F), [Google Compute Engine](https:\u002F\u002Fcloud.google.com\u002Fcompute\u002F), [Scaleway](https:\u002F\u002Fwww.scaleway.com\u002F), [DreamCompute](https:\u002F\u002Fwww.dreamhost.com\u002Fcloud\u002Fcomputing\u002F), [Linode](https:\u002F\u002Fwww.linode.com), other OpenStack-based cloud hosting, CloudStack-based cloud hosting, or [Hetzner Cloud](https:\u002F\u002Fwww.hetzner.com\u002F).\n\n2. **Get a copy of Algo.** The Algo scripts will be run from your local system. There are two ways to get a copy:\n\n    - Download the [ZIP file](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Falgo\u002Farchive\u002Fmaster.zip). Unzip the file to create a directory named `algo-master` containing the Algo scripts.\n\n    - Use `git clone` to create a directory named `algo` containing the Algo scripts:\n        ```bash\n        git clone https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Falgo.git\n        ```\n\n3. **Set your configuration options.** Open `config.cfg` in your favorite text editor. Specify the users you want to create in the `users` list. Create a unique user for each device you plan to connect to your VPN. You should also review the other options before deployment, as changing your mind about them later [may require you to deploy a brand new server](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Falgo\u002Fblob\u002Fmaster\u002Fdocs\u002Ffaq.md#i-deployed-an-algo-server-can-you-update-it-with-new-features).\n\n4. **Start the deployment.** Return to your terminal. In the Algo directory, run the appropriate script for your platform:\n\n    **macOS\u002FLinux:**\n    ```bash\n    .\u002Falgo\n    ```\n\n    **Windows:**\n    ```powershell\n    .\\algo.ps1\n    ```\n\n    The first time you run the script, it will automatically install the required Python environment (Python 3.11+). On subsequent runs, it starts immediately and works on all platforms (macOS, Linux, Windows via WSL). The Windows PowerShell script automatically uses WSL when needed, since Ansible requires a Unix-like environment. There are several optional features available, none of which are required for a fully functional VPN server. These optional features are described in the [deployment documentation](docs\u002Fdeploy-from-ansible.md).\n\nThat's it! You can now set up clients to connect to your VPN. Proceed to [Configure the VPN Clients](#configure-the-vpn-clients) below.\n\n```\n    \"#                          Congratulations!                            #\"\n    \"#                     Your Algo server is running.                     #\"\n    \"#    Config files and certificates are in the .\u002Fconfigs\u002F directory.    #\"\n    \"#              Go to https:\u002F\u002Fwhoer.net\u002F after connecting               #\"\n    \"#        and ensure that all your traffic passes through the VPN.      #\"\n    \"#                     Local DNS resolver 172.16.0.1                    #\"\n    \"#        The p12 and SSH keys password for new users is XXXXXXXX       #\"\n    \"#        The CA key password is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       #\"\n    \"#      Shell access: ssh -F configs\u002F\u003Cserver_ip>\u002Fssh_config \u003Chostname>  #\"\n```\n\n## Configure the VPN Clients\n\nCertificates and configuration files that users will need are placed in the `configs` directory. Make sure to secure these files since many contain private keys. All files are saved under a subdirectory named with the IP address of your new Algo VPN server.\n\n**Important for IPsec users**: If you want to add or delete users later, you must select `yes` at the `Do you want to retain the keys (PKI)?` prompt during the server deployment. This preserves the certificate authority needed for user management.\n\n### Apple\n\nWireGuard is used to provide VPN services on Apple devices. Algo generates a WireGuard configuration file, `wireguard\u002F\u003Cusername>.conf`, and a QR code, `wireguard\u002F\u003Cusername>.png`, for each user defined in `config.cfg`.\n\nOn iOS, install the [WireGuard](https:\u002F\u002Fitunes.apple.com\u002Fus\u002Fapp\u002Fwireguard\u002Fid1441195209?mt=8) app from the iOS App Store. Then, use the WireGuard app to scan the QR code or AirDrop the configuration file to the device.\n\nOn macOS, install the [WireGuard](https:\u002F\u002Fitunes.apple.com\u002Fus\u002Fapp\u002Fwireguard\u002Fid1451685025?mt=12) app from the Mac App Store. WireGuard will appear in the menu bar once you run the app. Click on the WireGuard icon, choose **Import tunnel(s) from file...**, then select the appropriate WireGuard configuration file.\n\nOn either iOS or macOS, you can enable \"Connect on Demand\" and\u002For exclude certain trusted Wi-Fi networks (such as your home or work) by editing the tunnel configuration in the WireGuard app. (Algo can't do this automatically for you.)\n\nIf you prefer to use the built-in IPsec VPN on Apple devices, or need \"Connect on Demand\" or excluded Wi-Fi networks automatically configured, see the [Apple IPsec client setup guide](docs\u002Fclient-apple-ipsec.md) for detailed configuration instructions.\n\n### Android\n\nWireGuard is used to provide VPN services on Android. Install the [WireGuard VPN Client](https:\u002F\u002Fplay.google.com\u002Fstore\u002Fapps\u002Fdetails?id=com.wireguard.android). Import the corresponding `wireguard\u002F\u003Cname>.conf` file to your device, then set up a new connection with it. See the [Android setup guide](docs\u002Fclient-android.md) for detailed installation and configuration instructions.\n\n### Windows\n\nWireGuard is used to provide VPN services on Windows. Algo generates a WireGuard configuration file, `wireguard\u002F\u003Cusername>.conf`, for each user defined in `config.cfg`.\n\nInstall the [WireGuard VPN Client](https:\u002F\u002Fwww.wireguard.com\u002Finstall\u002F#windows-7-8-81-10-2012-2016-2019). Import the generated `wireguard\u002F\u003Cusername>.conf` file to your device, then set up a new connection with it. See the [Windows setup instructions](docs\u002Fclient-windows.md) for more detailed walkthrough and troubleshooting.\n\n### Linux\n\nLinux clients can use either WireGuard or IPsec:\n\nWireGuard: WireGuard works great with Linux clients. See the [Linux WireGuard setup guide](docs\u002Fclient-linux-wireguard.md) for step-by-step instructions on configuring WireGuard on Ubuntu and other distributions.\n\nIPsec: For strongSwan IPsec clients (including OpenWrt, Ubuntu Server, and other distributions), see the [Linux IPsec setup guide](docs\u002Fclient-linux-ipsec.md) for detailed configuration instructions.\n\n### OpenWrt\n\nFor OpenWrt routers using WireGuard, see the [OpenWrt WireGuard setup guide](docs\u002Fclient-openwrt-router-wireguard.md) for router-specific configuration instructions.\n\n### Other Devices\n\nFor devices not covered above or manual configuration, you'll need specific certificate and configuration files. The files you need depend on your device platform and VPN protocol (WireGuard or IPsec).\n\n* ipsec\u002Fmanual\u002Fcacert.pem: CA Certificate\n* ipsec\u002Fmanual\u002F\u003Cuser>.p12: User Certificate and Private Key (in PKCS#12 format)\n* ipsec\u002Fmanual\u002F\u003Cuser>.conf: strongSwan client configuration\n* ipsec\u002Fmanual\u002F\u003Cuser>.secrets: strongSwan client configuration\n* ipsec\u002Fapple\u002F\u003Cuser>.mobileconfig: Apple Profile\n* wireguard\u002F\u003Cuser>.conf: WireGuard configuration profile\n* wireguard\u002F\u003Cuser>.png: WireGuard configuration QR code\n\n## Setup an SSH Tunnel\n\nIf you turned on the optional SSH tunneling role, local user accounts will be created for each user in `config.cfg`, and SSH authorized_key files for them will be in the `configs` directory (user.pem). SSH user accounts do not have shell access, cannot authenticate with a password, and only have limited tunneling options (e.g., `ssh -N` is required). This ensures that SSH users have the least access required to set up a tunnel and can perform no other actions on the Algo server.\n\nUse the example command below to start an SSH tunnel by replacing `\u003Cuser>` and `\u003Cip>` with your own. Once the tunnel is set up, you can configure a browser or other application to use 127.0.0.1:1080 as a SOCKS proxy to route traffic through the Algo server:\n\n```bash\nssh -D 127.0.0.1:1080 -f -q -C -N \u003Cuser>@algo -i configs\u002F\u003Cip>\u002Fssh-tunnel\u002F\u003Cuser>.pem -F configs\u002F\u003Cip>\u002Fssh_config\n```\n\n## SSH into Algo Server\n\nYour Algo server is configured for key-only SSH access for administrative purposes. Open the Terminal app, `cd` into the `algo-master` directory where you originally downloaded Algo, and then use the command listed on the success message:\n\n```\nssh -F configs\u002F\u003Cip>\u002Fssh_config \u003Chostname>\n```\n\nwhere `\u003Cip>` is the IP address of your Algo server. If you find yourself regularly logging into the server, it will be useful to load your Algo SSH key automatically. Add the following snippet to the bottom of `~\u002F.bash_profile` to add it to your shell environment permanently:\n\n```\nssh-add ~\u002F.ssh\u002Falgo > \u002Fdev\u002Fnull 2>&1\n```\n\nAlternatively, you can choose to include the generated configuration for any Algo servers created into your SSH config. Edit the file `~\u002F.ssh\u002Fconfig` to include this directive at the top:\n\n```\nInclude \u003Calgodirectory>\u002Fconfigs\u002F*\u002Fssh_config\n```\n\nwhere `\u003Calgodirectory>` is the directory where you cloned Algo.\n\n## Adding or Removing Users\n\nAlgo makes it easy to add or remove users from your VPN server after initial deployment.\n\nFor IPsec users: You must have selected `yes` at the `Do you want to retain the keys (PKI)?` prompt during the initial server deployment. This preserves the certificate authority needed for user management. You should also save the p12 and CA key passwords shown during deployment, as they're only displayed once.\n\nTo add or remove users, first edit the `users` list in your `config.cfg` file. Add new usernames or remove existing ones as needed. Then navigate to the algo directory in your terminal and run:\n\n**macOS\u002FLinux:**\n```bash\n.\u002Falgo update-users\n```\n\n**Windows:**\n```powershell\n.\\algo.ps1 update-users\n```\n\nAfter the process completes, new configuration files will be generated in the `configs` directory for any new users. The Algo VPN server will be updated to contain only the users listed in the `config.cfg` file. Removed users will no longer be able to connect, and new users will have fresh certificates and configuration files ready for use.\n\n## Privacy and Logging\n\nAlgo takes a pragmatic approach to privacy. By default, we minimize logging while maintaining enough information for security and troubleshooting.\n\nWhat IS logged by default:\n* System security events (failed SSH attempts, firewall blocks, system updates)\n* Kernel messages and boot diagnostics (with reduced verbosity)\n* WireGuard client state (visible via `sudo wg` - shows last endpoint and handshake time)\n* Basic service status (service starts\u002Fstops\u002Ferrors)\n* All logs automatically rotate and delete after 7 days\n\nPrivacy is controlled by two main settings in `config.cfg`:\n* `strongswan_log_level: -1` - Controls StrongSwan connection logging (-1 = disabled, 2 = debug)\n* `privacy_enhancements_enabled: true` - Master switch for log rotation, history clearing, log filtering, and cleanup\n\nTo enable full debugging when troubleshooting, set both `strongswan_log_level: 2` and `privacy_enhancements_enabled: false`. This will capture detailed connection logs and disable all privacy features. Remember to revert these changes after debugging.\n\nAfter deployment, verify your privacy settings:\n```bash\nssh -F configs\u002F\u003Cserver_ip>\u002Fssh_config \u003Chostname>\nsudo \u002Fusr\u002Flocal\u002Fbin\u002Fprivacy-monitor.sh\n```\n\nPerfect privacy is impossible with any VPN solution. Your cloud provider sees and logs network traffic metadata regardless of your server configuration. And of course, your ISP knows you're connecting to a VPN server, even if they can't see what you're doing through it.\n\nFor the highest level of privacy, treat your Algo servers as disposable. Spin up a new instance when you need it, use it for your specific purpose, then destroy it completely. The ephemeral nature of cloud infrastructure can be a privacy feature if you use it intentionally.\n\n## Additional Documentation\n* [FAQ](docs\u002Ffaq.md)\n* [Troubleshooting](docs\u002Ftroubleshooting.md)\n* How Algo uses [Firewalls](docs\u002Ffirewalls.md)\n\n### Setup Instructions for Specific Cloud Providers\n* Configure [Amazon EC2](docs\u002Fcloud-amazon-ec2.md)\n* Configure [Azure](docs\u002Fcloud-azure.md)\n* Configure [DigitalOcean](docs\u002Fcloud-do.md)\n* Configure [Google Cloud Platform](docs\u002Fcloud-gce.md)\n* Configure [Vultr](docs\u002Fcloud-vultr.md)\n* Configure [CloudStack](docs\u002Fcloud-cloudstack.md)\n* Configure [Hetzner Cloud](docs\u002Fcloud-hetzner.md)\n\n### Install and Deploy from Common Platforms\n* Deploy from [macOS](docs\u002Fdeploy-from-macos.md)\n* Deploy from [Windows](docs\u002Fdeploy-from-windows.md)\n* Deploy from [Google Cloud Shell](docs\u002Fdeploy-from-cloudshell.md)\n* Deploy from a [Docker container](docs\u002Fdeploy-from-docker.md)\n\n### Setup VPN Clients to Connect to the Server\n* Setup [Windows](docs\u002Fclient-windows.md) clients\n* Setup [Android](docs\u002Fclient-android.md) clients\n* Setup [Linux](docs\u002Fclient-linux.md) clients with Ansible\n* Setup Ubuntu clients to use [WireGuard](docs\u002Fclient-linux-wireguard.md)\n* Setup Linux clients to use [IPsec](docs\u002Fclient-linux-ipsec.md)\n* Setup Apple devices to use [IPsec](docs\u002Fclient-apple-ipsec.md)\n* Setup Macs running macOS 10.13 or older to use [WireGuard](docs\u002Fclient-macos-wireguard.md)\n\n### Advanced Deployment\n* Deploy to your own [Ubuntu](docs\u002Fdeploy-to-ubuntu.md) server, and road warrior setup\n* Deploy from [Ansible](docs\u002Fdeploy-from-ansible.md) non-interactively\n* Deploy onto a [cloud server at time of creation with shell script or cloud-init](docs\u002Fdeploy-from-script-or-cloud-init-to-localhost.md)\n* Deploy to an [unsupported cloud provider](docs\u002Fdeploy-to-unsupported-cloud.md)\n\nIf you've read all the documentation and have further questions, [create a new discussion](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Falgo\u002Fdiscussions).\n\n## Endorsements\n\n> I've been ranting about the sorry state of VPN svcs for so long, probably about\n> time to give a proper talk on the subject. TL;DR: use Algo.\n\n-- [Kenn White](https:\u002F\u002Ftwitter.com\u002Fkennwhite\u002Fstatus\u002F814166603587788800)\n\n> Before picking a VPN provider\u002Fapp, make sure you do some research\n> https:\u002F\u002Fresearch.csiro.au\u002Fng\u002Fwp-content\u002Fuploads\u002Fsites\u002F106\u002F2016\u002F08\u002Fpaper-1.pdf ... – or consider Algo\n\n-- [The Register](https:\u002F\u002Ftwitter.com\u002FTheRegister\u002Fstatus\u002F825076303657177088)\n\n> Algo is really easy and secure.\n\n-- [the grugq](https:\u002F\u002Ftwitter.com\u002Fthegrugq\u002Fstatus\u002F786249040228786176)\n\n> I played around with Algo VPN, a set of scripts that let you set up a VPN in the cloud in very little time, even if you don’t know much about development. I’ve got to say that I was quite impressed with Trail of Bits’ approach.\n\n-- [Romain Dillet](https:\u002F\u002Ftwitter.com\u002Fromaindillet\u002Fstatus\u002F851037243728965632) for [TechCrunch](https:\u002F\u002Ftechcrunch.com\u002F2017\u002F04\u002F09\u002Fhow-i-made-my-own-vpn-server-in-15-minutes\u002F)\n\n> If you’re uncomfortable shelling out the cash to an anonymous, random VPN provider, this is the best solution.\n\n-- [Thorin Klosowski](https:\u002F\u002Ftwitter.com\u002Fkingthor) for [Lifehacker](http:\u002F\u002Flifehacker.com\u002Fhow-to-set-up-your-own-completely-free-vpn-in-the-cloud-1794302432)\n\n## Contributing\n\nSee our [Development Guide](docs\u002FDEVELOPMENT.md) for information on:\n* Setting up your development environment\n* Using prek hooks for code quality\n* Running tests and linters\n* Contributing code via pull requests\n\n## Support Algo VPN\n[![PayPal](https:\u002F\u002Fwww.paypalobjects.com\u002Fen_US\u002Fi\u002Fbtn\u002Fbtn_donate_SM.gif)](https:\u002F\u002Fwww.paypal.com\u002Fcgi-bin\u002Fwebscr?cmd=_s-xclick&hosted_button_id=CYZZD39GXUJ3E)\n[![Patreon](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fback_on-patreon-red.svg)](https:\u002F\u002Fwww.patreon.com\u002Falgovpn)\n\nAll donations support continued development. Thanks!\n\n* We accept donations via [PayPal](https:\u002F\u002Fwww.paypal.com\u002Fcgi-bin\u002Fwebscr?cmd=_s-xclick&hosted_button_id=CYZZD39GXUJ3E) and [Patreon](https:\u002F\u002Fwww.patreon.com\u002Falgovpn).\n* Use our [referral code](https:\u002F\u002Fm.do.co\u002Fc\u002F4d7f4ff9cfe4) when you sign up to Digital Ocean for a $10 credit.\n* We also accept and appreciate contributions of new code and bugfixes via Github Pull Requests.\n\nAlgo is licensed and distributed under the AGPLv3. If you want to distribute a closed-source modification or service based on Algo, then please consider \u003Ca href=\"mailto:opensource@trailofbits.com\">purchasing an exception\u003C\u002Fa> . As with the methods above, this will help support continued development.\n","Algo VPN 是一套用于在云端快速搭建个人 WireGuard 和 IPsec VPN 的 Ansible 脚本。它采用最安全的默认设置，支持 IKEv2 和 WireGuard 协议，确保数据传输的安全性，并且兼容 iOS、macOS、Linux、Android 以及 Windows 11 等多种操作系统。项目提供了生成配置文件和二维码的功能，便于用户在不同设备上轻松配置 VPN 客户端；同时具备用户管理脚本、广告拦截及隐私保护等特性。基于 Ubuntu 22.04 LTS 构建，自动接收安全更新，适合需要增强在线隐私保护或远程访问自家网络资源的个人用户使用，尤其适用于对安全性有较高要求但又不希望复杂配置过程的技术爱好者。",2,"2026-06-11 02:48:29","top_language"]