How to install Pi-hole on Raspberry Pi 4 with Ubuntu server
Hardware
Hardware used:
- Rapberry Pi 4, 2GB
- MicroSD card, 16 GB
Write an image to the microSD card
I’m using Raspberry Pi Imager and the OS I’ve chosen is Ubuntu Server 20.10 64 bit for ARM.
Insert microSD card, connect Raspberry Pi to your network, SSH
After plugging Raspberry Pi into my local network, it will receive a dynamic IP fom my DHCP server. I will find it by using nmap to scan my network. I’m looking for a PC with only SSH port open:
Now connect to RaspberryPI and go through the initial setup. The default user and password is ubuntu/ubuntu - you will be required to change it.
Install pi-hole
Following pi-hole documentation install it. Follow the installer.
Note the password given at the end of the process, ie:
Reboot
Login to web interface, configure
Login to web interface using static IP assigned during the installation.
Go to group management -> Adlist and (optionally) change the default list of hosts - from https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts into another one, if you want to filter more:
https://github.com/StevenBlack/hosts
Then rebuild the database under Tools -> Update Gravity
Set up your local router
Setup your router (DHCP server) to point to the static IP of your pi-hole as a DNS server.