WireGuard autoinstaller written in Bash
WireGuard road warrior installer for Ubuntu, Debian, CentOS and Fedora!
This script will install automatically the Wireguard server and generate client configuration files for a secure connection.
wget http://git.io/Jff1k -qO wg.sh && bash wg.shcurl http://git.io/Jff1k -sSLo wg.sh && bash wg.sh/bin/bash -c "$(curl -fsSL http://git.io/Jff1k)"git clone https://github.com/its0x08/wg-install.git
cd wg-install
bash wg-install.shYou can run it again to generate more users after the first run, or remove WireGuard. Reboot your server to apply all settings.
wg-quick up config_nameThe script can be configured by setting the following environment variables:
- INTERACTIVE - if set to "no", the script will not prompt for user input
- PRIVATE_SUBNET - private subnet configuration, (default:
10.9.0.0/24) - SERVER_HOST - public IP address, detected by default
- SERVER_PORT - listening port, picked randomly by default
- CLIENT_DNS - comma serparated DNS servers to use by the client
- ADD_REMOVE - set to
1to remove WireGuard or2to add new users - WG_CONFIG - set config location (default:
/etc/wireguard/wg0.conf)
Copy the file /root/client-wg0.conf from a remote server to your local PC
path /etc/wireguard/wg0.conf and run sudo systemctl start wg-quick@wg0.service or
you can use the QR code generated by this script to auto-add mobile clients.
To check VPN status, run wg.