Having a pi-hole in your network will transform your online experience massively, so much so that when you have to surf the web whilst away form home, you’ll realise how much your pi-hole is blocking when you visit web pages.

In this final post of the mini-series of blogs on the Pi-hole, I look at how to build a VPN (Virtual Private Network) on your pi-hole and use that whenever you are out of home to surf the web as if you were in the comfort of your pi-hole-protected network.

When I set my VPN up, I decided to go with OpenVPN. There are other solutions such as piVPN , but I have used OpenVPN before, so I went with what I knew, plus It’s easy to setup OpenVPN on Ubuntu.

Installing OpenVPN

The process of installing and configuring OpenVPN is explained in great detail on the pi-hole.net website, so there is not much point me regurgitating that here, so head over to their site and check out how simple it is to install and configure OpenVPN.

Post OpenVPN install activities

Ah, you are back – great! See how easy it is to install your own VPN? It’s a magical thing it really is…

You may have noticed in the pi-hole.net instructions, it mentions that you will need to port forward the VPN listener port in order for outside connections to be able to reach the pi-hole and OpenVPN service.

Port forwarding notice from pi-hole.net

To do this requires you to access your home router’s admin pages. So open a browser, enter your routers IP address and log in.

Depending on the router, the port forwarding options will be located in different places, so have a look around. On my Virgin Media router, the port forwarding options are under the Security option, which in turn is under the Advanced option.

Port Forwarding on a Virgin Media router

In here I click Add a new rule which gives me the options shown below:

Creating a port forwarding rule

For the local IP, you need to specify the IP address of your Pi-hole. In my case my pi-hole uses 192.168.0.3 as it’s address.

For the local and external start and end ports you need to specify the value set when you installed OpenVPN – the default is port 1194, so enter 1194 in all 4 of these boxes.

For the protocol, select Both TCP and UDP and then select Enabled = Yes.

Make sure to click Add rule to commit the changes

You should now have a port-forwarding rule established.

Port forwarding rule

Connecting clients

Once you have the VPN service installed and reachable via your network, you need to build a VPN configuration file which you will use on the devices you want to be able to use your VPN.

Once again, the detailed guide on pi-hole.net is way better than anything I could write, so head over there and see how to create client certificates

Similarly, the instructions on how to transfer the client certificate file to your device is also covered in great detail.

Once you have the file installed on your mobile device, open the OpenVPN app and click the VPN file – it will auto-connect to your VPN service.

Running the OpenVPN app

Assuming you have configured everything correctly, the VPN tunnel will be established and you can now surf the web from your home network, with the added security of your pi-hole.

Connecting to your OpenVPN service

Once again, I’ll include screenshots here of web browsing on a mobile with and without using the pi-hole…

This is a screenshot of the Gloucestershire live website without having the luxury of using the pi-hole (im on my 5G connection) – note the adverts!

Mobile web browsing with no pi-hole

And the same website being viewed via my VPN, and pi-hole.

With no ads!

Mobile web browsing with the pi-hole

Stopping your VPN is easy, simply go back to the OpenVPN app, and click on the VPN connection. This will display a pop-up where you can disconnect.

Disconnecting the VPN

And that’s it!

Thanks for reading this mini-series on the pi-hole, I hope you’ve enjoyed it and found them useful.

If you do decide to install your pi-hole (which I urge everyone to do) please remember that the people behind this awesome utility do this all for free. However if, like me, you think that the pi-hole is an amazing piece of kit – please consider donating a bit of cash to them, so they can keep updating and innovating this brilliant service.

There is a link to donate at the bottom of your pi-hole dashboard!

Link to donate to the Pi-hole peeps!

You can donate as much as you want – even the price of a coffee would be welcomed I’m sure.

Please donate – I have.

My donation

I don’t know what tomorrow’s blog will be yet, so check in and find out…