How to set up Pi-Hole on Raspberry Pi Zero W
Pi-Hole on raspberry pi zero was my Sunday project. I like to build home automation. I saw this application the first time on https://www.raspberrypi.org/blog/pi-hole-raspberry-pi/ and decided to implement it for my home.
Pi-Hole is a Network-wide Ad Blocking application. Pi-hole is also known as Linux network-level advertisement and Internet tracker blocking the application. Click for more details.
Here is the shopping list;
- Raspberry Pi ZERO W: https://amzn.to/2KgPWUi
- Sandisk Ultra 64GB MicroSDXC card: https://amzn.to/389iqZL
- Power adapter 5V 2.5A https://amzn.to/35ZIROQ
- Official Case https://amzn.to/3nqNBox
There are many options when you want to flash OS to a USB drive. In this setup, I preferred Raspberry Pi Imager. Download the latest version of Raspberry Pi Imager and install it.
First is first, don't forget to format your sd card. Open Raspberry Pi Imager and choose the Raspbian lite from the list presented and click ‘WRITE’ to begin writing data to the SD card.
After the flashing, add a text file named "ssh" in the boot partition.
sudo touch /Volumes/boot/ssh
Setup of the Raspberry Pi
To connect to RP;
ssh [email protected]
When asked to enter a password, type "raspberry". (RP default password).
To config our RP and change to the hostname or other related settings;
At this point, you need to decide how you connect your raspberry pi zero w after installation. Password or SSH key? I'll go with a password but I strongly recommend using SSH.
After changing the default password, you may want need to change the hostname and IP addresses. To assign a static IP address to RP, we need to edit dhcpcd.conf file;
sudo nano /etc/dhcpcd.conf
interface wlan0 static ip_address=10.0.0.61/8 static routers=10.0.0.1 static domain_name_servers=18.104.22.168 22.214.171.124
All we need is 1 line script.
curl -sSL https://install.pi-hole.net | bash
In case you need to update;
Pi-hole comes with a pre-defined two advertisement block list. If you want to extend these lists, you can find them on the internet.
We completed the Pi-Hole installation on RPZW's. Feel free to discover your newly created homemade Pi-hole.
PS: This screenshot is from my setup;