Bash scripts to take Ubuntu Server LTS 24.04 from clean install to fully-configured WireGuard server peer, forwarding DNS queries to Cloudflare over TLS.
setup.shsets up the server (run once)addclient.shcreates a peer, printing the config as text and a QR code (run for each new client)
The server is configured for unattended security upgrades and firewalled with iptables to allow only SSH, WireGuard and some ICMP types.
Clients are visible to each other, and can be found via DNS as my-client-name.wg.internal.
One-time only (as root):
wget https://raw.githubusercontent.com/jawj/wireguard-setup/refs/heads/main/setup.sh
chmod u+x setup.sh
./setup.shTo add a client (as root):
wget https://raw.githubusercontent.com/jawj/wireguard-setup/refs/heads/main/addclient.sh
chmod u+x addclient.sh
./addclient.shTo show status (as root):
wg showhttps://github.com/jawj/IKEv2-setup
MIT