Server-to-server Wireguard

On both peers, install the Wireguard module and tools:

apt install wireguard

Create the configuration file at /etc/wireguard/wg0.conf:

Address =
PrivateKey = `wg genkey`

PublicKey = `wg pubkey < privkey-of-other-peer`
PresharedKey = `wg genpsk`
AllowedIPs =

The PresharedKey must be identical across peers. Make sure to share it over a secure channel.
On at least one of the peers, set Endpoint in the [Peer] section to the internet hostname and listening port of the other peer. Set the listening port by adding Port to the [Interface] section.
You will need to set AllowedIPs to the Address of the other peer. You can use another subnet if is already being used.

Turn on the tunnel using:

wg-quick up wg0

See connection information using:

wg show

Try pinging the other peer: