Installation of Wireguard on Raspberry Pi
The following is my writeup on how to install and configure Wireguard on a Raspberry Pi. At the moment, this is not available to sudo apt get so the following documents how to build against the Raspbian headers.
As a word of caution DO NOT rpi-update at any stage before or after following this guide. Not only is this no_longer_recommended with the risk of destroying your system, but you will advance to a kernel where you will have no raspberrypi-kernel-headers that you can easily obtain vi apt. Much of this was based on the following page. Note that if you are able to sudo apt install wireguard then you can skip the building Wireguard section.
sudo apt update && sudo apt upgrade
Reboot if necessary and the, install the required packages:
sudo apt install libmnl-dev build-essential git qrencode
Then clone Wireguard from GitHub
git clone https://git.zx2c4.com/WireGuard
You should also get the raspberrypi-kernel-headers to build Wireguard against.
sudo apt install raspberrypi-kernel-headers
Then cd into the directory and make
cd WireGuard/src/ make sudo make install
For the next steps, to configure wireguard, please see Configuration of Wireguard.