WireGuard continues to grow in popularity. Linus Torvalds followed through on earlier positive comments about the package and pulled the WireGuard VPN into the Linux 5.6 kernel source tree. While Ubuntu 20.04 used the 5.4 kernel, it came with WireGuard installed. With its typically cautious approach, Debian integrated the package into the December 2021 release of bullseye
. However the package was back ported to Buster
so that the wireguard
package has been available in the Raspberry Pi OS repository since May 7, 2021. Before that, it was possible to install WireGuard in older versions of the OS for the Raspberry Pi, but that was a rather more involved and sometimes quite lengthy process.
This has been a rapidly evolving topic which has prompted me to write a number of posts since the first one on July 4, 2019. There have been so many similar posts and various updates that I became confused about these and decided to make a list of those articles that are still available on this site.
These posts somehow remind me of the much abused adage about probabilities: "given enough time, paper, typewriters and monkeys haphazardly pounding at the keys, the complete works of Shakespeare will be typed out." So maybe, just maybe, I got it right but remember that I am only one monkey using one keyboard, without deep knowledge of networking and therefore relying on the Web for information. By the way, that's a picture of a youthful me at the keyboard. Currently, there's a lot more gray in my beard and the keyboard is steam driven.
If it's not clear yet, I am out of my depth here, so take care to thouroughly test anything I put forward. You have been warned!- July 4, 2019:
- Installing WireGuard on Raspbian Stretch and Buster
The original post, it described how to install the WireGuard package from the Debianunstable
repository following Adrian Mihalko's instructions. - April 17, 2020:
- Installing and Configuring WireGuard on Raspbian Buster
An update of the original post on how to install the WireGuard package from the Debianunstable
repository, but it included more information on the configuration and use of the VPN server. - July 4, 2020:
- Installing and Configuring WireGuard on Raspberry Pi OS (May 2020)
Amended version of the original post, wherein the installation is in Raspberry Pi OS instead of Raspbian Buster and the discussion on managing users is expanded. - July 28, 2020:
- Installing WireGuard on all Raspberry Pi Models (July 2020)
An quickly written addendum to the previous post about using the WireGuard package from the Rasbiantesting
repository. - August 3, 2020:
- Installing WireGuard on Raspberry Pi OS (August 2020)
A combination of the last two posts about installing the WireGuard package from the Rasbiantesting
repository only on any Raspberry Pi model running the 32 bit May 27 2020 version of Raspberry Pi OSLite
. - January 6, 2021:
- Installing and Configuring WireGuard on Raspberry Pi OS (January 2021)
A slight rewrite of the August version about installing the WireGuard package from the Rasbiantesting
repository only on any Raspberry Pi model running the December 2nd 2020 version of Raspberry Pi OSLite
. - March 3, 2021:
- Installing WireGuard on openmediavault 5.6.1 (March 2021)
Installing a WireGuard virtual private network server on openmediavault running on an x86-64 system was faster and simpler than on the Raspberry Pi. The user and server configuration script by Adrian Mihalko worked just as well with just a little tweak for the network interface name.
Originally published with the title Installing and Configuring WireGuard on Raspberry Pi OS (September 2021), it was an update of the January 6, 2021 version needed because the
wireguard
package became available in the Raspberry Pi OS repository so that installation became quite simple. There was no change to configuration of the "server" or of the "clients". This remains the most current of my guides to installing and configuring WireGuard on Raspberry Pi OS (Buster) including the current Legacy version of the OS.An addendum to the previous post with a solution for running Wireguard on the Bullseye version of Raspberry Pi OS which has been available since January 28, 2022. It's a rewrite of section 3.5 Editing the Server Configuration Template to use
nftables
which has replaces iptables
. The rest of the September post remains valid. This tempory update has now been replaced with the following postThe January 28, 2022 release of Raspberry Pi OS based on Debian 11 (
Bullseye
) broke the installation procedure described in the September 25, 2021 post because the iptables
package is no longer included. This post is a complete guide which now shows how to route IP packets through a Wireguard VPN "server" using nftables
. The way to set up Wireguard VPN "clients" in Windows, Android and Linux is shown but it has not changed. That includes clients in the most recent version of Raspberry Pi OS with nftables
.
This is a mess. Hopefully, the latest post will be clearer. While the older posts remain valid, they should no longer be read unless there is a need to install WireGuard on an older version of Raspbian, Raspberry Pi OS or OpenMediaVault.