What it is for
With WireGuard you create a private network between your computer (or your team’s) and your server. Sensitive services listen only on that network, so from the internet they do not exist.
The steps, in short
- Install WireGuard on the server and on your machine.
- Generate a key pair on each end (
wg genkeyandwg pubkey). The private key never leaves its machine. - Configure the server in
/etc/wireguard/wg0.conf: a private network address (for example10.8.0.1/24), the UDP port (51820 is the usual one) and each client as a[Peer]with its public key. - Configure the client with its own address (
10.8.0.2/32), the server’s public key, theEndpointand theAllowedIPsyou want to route. - Open the UDP port in the firewall and bring the interface up with
wg-quick up wg0(andsystemctl enableso it starts on its own). - Make your services listen only on the private network and test by connecting to them at that address.
Common mistakes
- Forgetting to open the UDP port in the provider’s firewall as well as the server’s firewall.
- Accidentally using
AllowedIPs = 0.0.0.0/0and sending all your traffic through the VPN. - Sharing the same key between several people: each device should have its own so it can be revoked.
- Leaving the service also open to the internet “just in case”.
How we help
We set up the VPN, generate each person’s keys and move your sensitive services onto the private network, with clear instructions for your team.