Back in issue 336 we showed you how to configure a Raspberry Pi as a VPN gateway for your home network, routing all your internet traffic through a secure, external VPN server.
But what if you want to do the opposite? Running a VPN server on your local network enables you to securely access home devices such as NAS appliances and printers from anywhere in the world. You can also route your internet activity through your home ISP connection when you’re travelling – handy for getting around local access restrictions, or if you’re using an untrusted Wi-Fi service and want to ensure the operator can’t spy on your activity.
A VPN server can be hosted on almost any computer, and inbound VPN capabilities are also built in to some routers. However, as in so many scenarios, the Raspberry Pi makes an excellent choice of platform as it’s very cheap to acquire and run, yet powerful enough to support advanced features and configurations that aren’t normally available on router-based VPNs. That applies even if you’re using the most lightweight board: the PiVPN system we’ll discuss below will run happily on any model, including the Zero, as long as it runs Raspberry Pi OS.
Introducing PiVPN
PiVPN () is a free package that automatically installs and configures VPN server software on your Raspberry Pi. To be clear, it’s not a VPN server itself, but rather a friendly installer and manager for the open-source OpenVPN and WireGuard VPN server components. If you’re a Linux enthusiast