需在受支持的 Linux 发行版上以 root 权限运行,脚本会安装内核模块并创建 systemd 服务;脚本从 GitHub raw 地址下载,网络受限环境需自行获取文件;README 未说明默认端口等细节,需按脚本交互提示填写。
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.shREADME 未说明硬件要求,仅列出支持的发行版(AlmaLinux 8+、Alpine、Arch、CentOS Stream 8+、Debian 10+、Fedora 32+、Oracle Linux、Rocky Linux 8+、Ubuntu 18.04+)
一条 bash 脚本在 Linux 服务器上快速搭好 WireGuard VPN,省去手工配置
一条命令在 Linux 服务器上装好 WireGuard VPN,自动生成密钥、配置 NAT 和客户端,省去手动配置的麻烦。
核心能力
- 用交互式问答自动安装 WireGuard 内核模块与工具
- 自动生成服务端配置、systemd 服务与客户端配置文件
- 支持 IPv4 与 IPv6 双栈
- 重复运行脚本即可添加或删除客户端
- 服务端对客户端流量做 NAT,出口显示为服务器 IP
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
WireGuard installer
This project is a bash script that aims to setup a WireGuard VPN on a Linux server, as easily as possible!
WireGuard is a point-to-point VPN that can be used in different ways. Here, we mean a VPN as in: the client will forward all its traffic through an encrypted tunnel to the server. The server will apply NAT to the client's traffic so it will appear as if the client is browsing the web with the server's IP.
The script supports both IPv4 and IPv6. Please check the issues for ongoing development, bugs and planned features! You might also want to check the discussions for help.
WireGuard does not fit your environment? Check out openvpn-install.
Requirements
Supported distributions:
- AlmaLinux >= 8
- Alpine Linux
- Arch Linux
- CentOS Stream >= 8
- Debian >= 10
- Fedora >= 32
- Oracle Linux
- Rocky Linux >= 8
- Ubuntu >= 18.04
Usage
Download and execute the script. Answer the questions asked by the script and it will take care of the rest.
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
./wireguard-install.sh
It will install WireGuard (kernel module and tools) on the server, configure it, create a systemd service and a client configuration file.
Run the script again to add or remove clients!
Providers
I recommend these cheap cloud providers for your VPN server:
- Vultr: Worldwide locations, IPv6 support, starting at $5/month
- Hetzner: Germany, Finland and USA. IPv6, 20 TB of traffic, starting at 4.5€/month
- Digital Ocean: Worldwide locations, IPv6 support, starting at $4/month
Contributing
Contributions are welcome! Here's how you can help:
Discuss changes
Please open an issue before submitting a PR if you want to discuss a change, especially if it's a big one.
Code formatting
We use shellcheck and shfmt to enforce bash styling guidelines and good practices. They are executed for each commit / PR with GitHub Actions, so you can check the configuration here.
Say thanks
You can say thanks if you want!
Credits & Licence
This project is under the MIT Licence