WireGuard Setup Guide - ajgillis04/GillisDockerDepot GitHub Wiki
WireGuard is a fast, modern, and secure VPN tunnel that provides ease of use and high performance. It is available for various platforms including Windows, Linux, macOS, iOS, and Android.
- Docker installed (optional, for containerized setup)
-
Docker: My preferred use case continue to
Step 2
- Windows: Download the installer from the official WireGuard website and follow the installation instructions.
-
Linux: Use your package manager to install WireGuard. For example, on Ubuntu:
sudo apt install wireguard
- Open
wireguard.yaml
and update the unique to you settings - ALLOWEDIPS: 0.0.0.0/0,<your networks IP range
- PEERDNS: ${PIHOLE_PRI} - This is optional, this will make sure everyone who connects to the VPN will use PIHole
- INTERNAL_SUBNET: <Choose an IP range for your VPN clients ie) 192.168.10.0
- PEERS: <Give each peer you intend to connect with a name here. You can add more later)
- Save
wireguard.yaml
- Re-create the container
docker compose -p mediaserver -f docker-compose-server<num>.yaml up --detach
Follow these steps to reset the private and public keys for a WireGuard peer:
-
Generate New Private Key:
wg genkey | tee /path/to/new_private_key
-
Generate New Public Key from Private Key:
- Note, if you get Permission denied set the permissions to write for the file.
wg pubkey < /path/to/new_private_key > /path/to/new_public_key
-
Update WireGuard Configuration File:
- Update your WireGuard configuration file (wg0.conf or similar) with the new keys.
-
Restart WireGuard Interface:
- Restart the WireGuard interface to apply the changes.
sudo wg-quick down wg0 sudo wg-quick up wg0
-
Update Peers:
- Inform the affected peer(s) to update their configuration with the new public key.