In the most recent chapter of the Privacy Cookbook, no. 18, The One with the Pi, I covered a simple solution to becoming your very own Bitcoin lightning node, or even starting a small bitcoin company and all with a $35 USD Raspberry Pi.

Now I have previously covered VPN solutions before and also explained the need for a Firewall and a decent and secure DNS setup, however, what I didn't cover was an all-in-one solution, at home, using your Raspberry Pi.

One great solution is called PiVPN. It is an WireGuard or OpenVPN solution you can deploy on a server (to have a different IP) or at home with a Raspberry Pi. This means you would still have the original IP address, no slowdown in internet speed, but encrypted traffic so your ISP or any third-party can't see what you are doing online. It'll keep you safe and, best of all, you can combine it with a Pi-Hole setup and/or use AdguardHome or even NextDNS for the Adblocking. Of course, you can ultimately choose any DNS provider you want.

Let's dive in

First, of course, you need a Raspberry Pi. Next, unlike as with Umbrel, you do need to actually install the OS. This can be done with the Raspberry Imager.

Raspberry Pi OS – Raspberry Pi
The Raspberry Pi is a tiny and affordable computer that you can use to learn programming through fun, practical projects. Join the global Raspberry Pi community.

For this setup, you can use any of the Raspberry OS flavours. Including the Light one.

If you want to install Pi-Hole you need to do this first:

Home
1. Install a supported operating system You can run Pi-hole in a container, or deploy it directly to a supported operating system via our automated installer. D

curl -sSL https://install.pi-hole.net | bash

This will install the Pi-Hole, it is straightforward, so all you need to do is follow the screen.

If you prefer to use AdGuardHome, go to AdGuardHome page and download binaries for Raspberry Pi.

wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv6.tar.gz
tar xvf AdGuardHome_linux_armv6.tar.gz```

It will unpack into a new directory called AdGuardHome.

All you have to do is simply type this command to the Terminal:

cd AdGuardHome
sudo ./AdGuardHome -s install

Once it's up and running, you can access your AdGuardHome web interface on port 3000 by typing this in your browser — http://192.168.10.20:3000/

Don't forget to substitute 192.168.10.20 with IP of your Pi.

Once you setup any of these two solutions, jump over to:

https://pivpn.io/

Or just use your Terminal and:

curl -L https://install.pivpn.io | bash

All you need to do is follow the screen, the first pick is WireGuard or OpenVPN. I prefer WireGuard which is the pre-selected option. Select and follow the screen for the rest of the setup.

When the setup asks you for the DNS you want to choose, use the local one and IP to link it with your AdguardHome or Pi-Hole. If you use NextDNS you can find the IP address in your NextDNS control panel.

The entire set up is done in under 5 minutes and is pretty straightforward.

After the PiVPN is installed the terminal will recommend a reboot of the Pi. Do the reboot and once the system is back up, open the terminal again and type

pivpn -a

This will add a VPN client. You can name it anything you like, for example, phone.

Once this is done just type:

pivpn -qr

This will generate a QR code which you can scan within your WireGuard application on your Phone, iPad etc. You can also generate a file to be used on the computers.

Repeat the setup for each device you would like to have access to your setup.

In some cases you need to do a port forwarding on your router, this port would be UDP port 1194 but most routers won't need you to do anything.

If you want to get a different IP address and use an WireGuard as your permanent VPN with a location away from home you can do the entire setup on Hetzner, DigitalOcean etc., these servers do not need any Port forwarding.

As you can see the Pi gives you the power to have your very own WireGuard encryption, combined with a strong firewall or DNS protection to block and protect you against ISP or 3rd party surveillance and blocks tracking, ads and malware at the same time.

The Raspberry Pi is the mightiest little device that most people have ever heard about but don’t use. Never fear, I will continue to explore and explain many more real use cases for the mighty Pi in upcoming sections of this chapter.