kota's memex

https://www.wireguard.com/

wg-quick

Generate public and private keys on all computers by using this: wg genkey | tee privatekey | wg pubkey > publickey

server (static domain name)

[Interface]
PrivateKey = servers private key here
Address = 192.168.3.1/24
ListenPort = 51821
Table = off

[Peer]
PublicKey = clients public key here
AllowedIPs = 0.0.0.0/0

The port must not be used by another wireguard service on the computers. You can tweak AllowedIPs for better security.

client (dynamic ip ... initiates communication)

[Interface]
PrivateKey = clients private key
Address = 192.168.3.2/24
ListenPort = 51821
Table = off

[Peer]
PublicKey = servers public key
AllowedIPs = 0.0.0.0/0
Endpoint = nilsu.org:51821

Endpoint is a public ip/domain name for the server.