Install the WireGuard packages. After this step, man wg and man wg-quick will work and the wg command gets bash completion.
Get the Server Public Key
(We’re on the server for this section.)
Print the server’s public key. We’ll need this soon.
Back on the Client
Create Client Keys
In every client/server relationship, each peer has its own private and public keys. Create private and public keys for the WireGuard client service. Protect the private key with a file mode creation mask.
Print the private key, we’ll need it soon.
oBkgA+KZU6mWY5p7d0PEWxnYkihBw9TmHZXEYnQkz3g=
Create the WireGuard client service config file at /etc/wireguard/wg0.conf. (Use a command like sudo nano /etc/wireguard/wg0.conf.)