← Back to blog
bpdubuntu
How to Configure a WireGuard VPN Server and Client
12 January 2026bpd · ubuntu
A Practical Guide to Your First WireGuard Tunnel
The ‘Ubuntu System Administration Guide’ provides a clear, practical example of how to set up a secure tunnel between an Ubuntu server and a client using WireGuard.
Server and Client Configuration
The setup involves creating a configuration file (e.g., `wg0.conf`) on both the server and the client.
- On the Server: The file defines the server’s private key, its IP address within the VPN, and a `[Peer]` section for each client. Each peer section contains the client’s public key and the IP address it will be assigned within the VPN.
- On the Client: The file defines the client’s private key, its assigned IP address, and a `[Peer]` section for the server. This section contains the server’s public key and its public internet IP address (the endpoint).
Once both files are in place, you can bring the tunnel up on both ends with the simple command `wg-quick up wg0`, establishing a secure and high-performance VPN connection.
This post is based from content of the book Ubuntu System adminstration guide. And the book can be found here https://www.amazon.com/stores/Mattias-Hemmingsson/author/B0FF5CQX13