How to set up Pi-Hole on Raspberry Pi Zero W

How to set up Pi-Hole on Raspberry Pi Zero W
Photo by La-Rel Easter / Unsplash


Pi-Hole on raspberry pi zero was my Sunday project. I like to build home automation. I saw this application the first time on 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;

  1. Raspberry Pi ZERO W:
  2. Sandisk Ultra 64GB MicroSDXC card:
  3. Power adapter 5V 2.5A
  4. Official Case

Flashing OS

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.

In macOS;

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;

sudo raspi-config

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=
static routers=
static domain_name_servers=

Pi-Hole Setup

All we need is 1 line script.

curl -sSL | bash

Check Status

pihole status


In case you need to update;

pihole -up

Ad Lists

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.

The End

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;

final pi-hole screen