Pi-Hole on Raspberry Pi all models using Docker

In this segment, we are going to show you how to “Install Pi-Hole on Raspberry Pi B Plus with the help of Docker

What is Pi-Hole?

Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole (and optionally a DHCP server), intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations.
Pi-hole can block traditional website adverts as well as adverts in unconventional places, such as smart TVs and mobile operating system adverts.

pihole

Software Required :

Equipment RequiredOptional
Raspberry PiRaspberry Pi 4Case
SD_CardSD Card
Raspberry Pi Keyboard
EthernetEthernet CableMouse
ChargerPower Adapter
HDDExternal HDD
Shop now

Raspbian OS Installation

Download Raspbian OS from Official Website: raspberrypi.org
Then write the image to the SD Card using: Etcher

etcher

Now, Boot the Raspberry Pi with this SD Card, Follow the On-Screen Instructions and then open Terminal.

Docker installation guide on Raspberry Pi

Pull Pi-Hole Docker Image

  • To pull the latest Pi-Hole docker image, we need to open Terminal and type the below-given command.
 docker pull pihole/pihole

 Run Pi-Hole Docker Image

  • Now we need to use the below-given command to run the docker container.
  • You have to set the path for docker folders in this command to successfully configure Pi-Hole.
 docker run -d \
    --name pihole \
    -p 53:53/tcp \
    -p 53:53/udp \
    -p 67:67/udp \
    -p 80:80 \
    -p 443:443 \
    -e PUID=1000 -e PGID=1000 \
    -e TZ=Asia/Kolkata \
    -v /mnt/pihole/pihole/:/etc/pihole/ \
    -v /mnt/pihole/dnsmasq.d/:/etc/dnsmasq.d/ \
    -e 127.0.0.1 \
    -e 1.1.1.1 \
    --restart=unless-stopped \
    pihole/pihole:latest

 Access Pi-Hole Web Interface

  • To access the Pi-Hole web interface, we need to use the HTTP://RaspberryPi_IP_Address/admin or just type HTTP://localhost/admin.
 http://IP/admin/

 To get random Password

docker logs pihole 2 /dev/null | 'grep password:'

 Reset Pi-Hole Password

docker exec -it pihole pihole -a -p

In conclusion

  • You are all set to use Pi-Hole on your Raspberry Pi with Docker.
  • If you come across any issues or have some feedback related to this tutorial, Please share your thoughts.

Did you find us helpful?

Subscribe our YouTube ChannelYouTube
Support us on PatreonPatreon
Like us on Facebookfacebook
Share This Article with others

Harish Kumar

As a founder of the PcMac YouTube channel and website, Our goal is to provide Free Technical help to people and spread knowledge to everyone.
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments