Awesome Open Source
Awesome Open Source

wg-install v20200626-1

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.

Usage command


wget -qO && bash

Steps to download and run the scripts:

git clone
cd wg-install

Add new client

You can run it again to generate more users after the first run. Reboot your server to apply all settings.

To start/activate the Wireguard client:

wg-quick up config_name


The 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, "" by default
  • SERVER_HOST - public IP address, detected by default
  • SERVER_PORT - listening port, picked random by default
  • CLIENT_DNS - comma serparated DNS servers to use by the client

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 [email protected] or you can use the QR code generated by this script to auto-add mobile clients.

Server/Client status:

To check VPN status, run wg.

Enjoy it !

Note: dont forget to report bugs please!!

Buy me a beer or coffe.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (232,761
Linux (16,559
Bash (7,037
Script (3,934
Ubuntu (3,351
Encryption (2,708
Debian (1,971
Fast (1,163
Vpn (1,094
Centos (759
Wireguard (322
Redhat (317
Kernel Module (190
Vpn Client (144
Vpn Server (144
Related Projects