For my VPN setup, I lean towards using Wireguard because it’s straightforward to configure and delivers great performance. This guide serves as a personal reference for when I need to set up Wireguard again—whether as a server or a client. While I typically run Ubuntu on my production servers, my personal homelab runs Archlinux. Although this guide is focused on Archlinux, the process is essentially the same on Ubuntu, aside from the installation details.

Another great feature of Wireguard is its flexibility—any host can function as a server or as a peer , and a peer can even act as a proxy for another peer without needing any special configuration.

I’ve organized the guide into two server and peer easy reference. Before getting started with either setup, ensure Wireguard is installed on both your server and client machines.

Pre-requisites

The first step is installing Wireguard. On Archlinux, run the following command as the root user or with sudo:

pacman -Syu --noconfirm wireguard-tools ufw

ufw is used to configure iptables on the machines in a much easier to use approach.

If you’re setting up Wireguard in a Proxmox LXC container (for either a server or client), follow these steps:

  • Open the container configuration file: /etc/pve/lxc/123.conf (replace 123 with your container ID).
  • Append these lines at the end of the file:
lxc.cgroup2.devices.allow: c 10:200 rwm 
lxc.mount.entry: /dev/net dev/net none bind,create=dir
  • Save and close the file.
  • Update the owner of the tun device by running:
    chown 100000:100000 /dev/net/tun

Server Details

For this example, here are the details I’m using:

Item Description
Public IP Address 1.1.1.1
Public Facing Interface eth0
Wireguard IP 10.201.1.1/24
Wireguard Port 51281
Wireguard Interface wg0
Wireguard Configuration /etc/wireguard/wg0.conf

When following this guide, be sure to replace these placeholder values with your own specific details. The configuration file is named after the interface: for example, if your interface is wg0, the configuration file will be wg0.conf.

Setup

Once everything is installed and your personalized details are in place, proceed with the respective guide for a server or peer setup to get things running.

Happy networking, and may your connections be fast and secure!