Skip to content
COL0

WireGuard VPN: secure access to your server and your database

Some things should never be open to the internet: databases, admin panels, internal tools. A WireGuard VPN gives you private access without exposing them.

Written by Victor Barrera

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

  1. Install WireGuard on the server and on your machine.
  2. Generate a key pair on each end (wg genkey and wg pubkey). The private key never leaves its machine.
  3. Configure the server in /etc/wireguard/wg0.conf: a private network address (for example 10.8.0.1/24), the UDP port (51820 is the usual one) and each client as a [Peer] with its public key.
  4. Configure the client with its own address (10.8.0.2/32), the server’s public key, the Endpoint and the AllowedIPs you want to route.
  5. Open the UDP port in the firewall and bring the interface up with wg-quick up wg0 (and systemctl enable so it starts on its own).
  6. 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/0 and 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.

Frequently asked questions

Is WireGuard faster or simpler than other VPNs?

It is known for a short configuration and high performance, and for using modern cryptography. That makes it a good first VPN for your own servers.

When should I use a VPN?

When you have services that only you or your team should use: databases, panels, test environments, or several servers that must talk over a private network.

Ready to publish your project?

Book your free 30-minute session and leave with a clear plan.

Book your free session