How to setup Pi Hole on Raspberry-Pi Zero W

Step by step pi hole on Raspberry-Pi 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 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 pi@raspberrypi.local

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 ad list. If you want to extend these lists, you can find them on the internet.

The End

We completed Pi-Hole installation on RPZW's. Feel free to discover your newly created home made Pi-hole.

PS: This screenshot from my setup;