Running PiHole - Network Wide Ad Blocker Using Docker
#Pihole #Docker #AdBlocker
Full steps can be found at https://i12bretro.github.io/tutorials/0478.html
--------------------------------------------------------------------
What is Pi-Hole?
--------------------------------------------------------------------
The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content, without installing any client-side software. - https://github.com/pi-hole/pi-hole
--------------------------------------------------------------------
Installing Docker
--------------------------------------------------------------------
01. Log into the Linux based device
02. Run the following commands in the terminal
# install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER
# edit resolvd config
sudo nano /etc/systemd/resolved.conf
03. Uncomment the line starting with DNSStubListener= and set the value to no
DNSStubListener=no
04. Press CTRL+O, Enter, CTRL+X to write the changes to resolved.conf
05. Continue with the following commands to restart systemd-resolve to free up port 53
# restart the systemd-resolve service
sudo systemctl restart systemd-resolved
--------------------------------------------------------------------
Running Pi-Hole
--------------------------------------------------------------------
01. Now that Docker is installed, run the following commands to setup the Pi-Hole Docker container and run it
# create working directories
mkdir /home/$USER/docker/pihole -p && mkdir /home/$USER/docker/pihole/dnsmasq.d -p
# run the pihole docker container
docker run -d --name=pihole -e TZ=America/New_York -e WEBPASSWORD=password -v /home/$USER/docker/pihole/:/etc/pihole -v /home/$USER/docker/pihole/dnsmasq.d:/etc/dnsmasq.d -p 80:80 -p 53:53/tcp -p 53:53/udp --restart=unless-stopped pihole/pihole
02. Once the Pi-Hole container is downloaded and running, open a web browser and navigate to http://DNSorIP/admin
Documentation: https://github.com/pi-hole/docker-pi-hole
### Connect with me and others ###
★ Discord: https://discord.com/invite/EzenvmSHW8
★ Reddit: https://reddit.com/r/i12bretro
★ Twitter: https://twitter.com/i12bretro