This repository contains scripts that make it easy to configure WireGuard on VPS.
This script has been updated from its original repository by @drew2a.
Original article is in Medium: How to deploy WireGuard node on a DigitalOcean's droplet
wget https://raw.githubusercontent.com/tessharp/wireguard/master/wg-server-up.sh
chmod +x ./wg-server-up.sh
./wg-server-up.sh -d unbound
# OR
./wg-server-up.sh -d pihole
- Review and fix Pihole deployment (Currently does not resolve appropriately)
- Simplify adding clients - remove requirement for assigning octet if not specified by user
This script will:
- Installs al necessary software on an empty Ubuntu DigitalOcean droplet (it should also work with most modern Ubuntu images)
- Configures IPv4 forwarding and appropriate iptables rules
- Sets up unbound or pihole as a DNS resolver
- Creates a server and clients configurations
- Installs qrencode
- Runs WireGuard
wg-server-up.sh -d [unbound|pihole]
./wg-server-up.sh -d unbound
Install WireGuard if it's not installed through the wg-server-up.sh
script.
This script will generate clients configs for WireGuard and add or remove the relevant user configuration to the server config. You need to supply the configuration file, client name, and last octet of the IP used to route the WireGuard traffic.
./wg-genconf-user.sh -c [configuration_file] -[a|d] [client_name] -o [IP_last_octet]
./wg-genconf-user.sh -c /etc/wireguard/wg0.conf -a client -o 5
./wg-genconf-user.sh -c /etc/wireguard/wg0.conf -d client