Home > Linux Knowledge > Setup PiHole on a Raspi 4
published 2025-01-28
Install & configure Raspian
Enter your SDCard into your SDCard reader. Use the official Raspian Imager (in the Void repos as rpi-imager). First choose your Raspi model, mine is Raspi 4B. Second choose your OS version, I chose Raspian Bookworm (based on Debian 12) Lite x64. Then select your SDCard as install target, hit install. When Imager asks if you want to customize OS settings, click "Edit Settings". Set hostname, username and password, enable SSH daemon. Click OK and Install. Remember those settings for later. After flashing is done, enter the SDCard into your Raspi, connect it to power supply and network and boot it. Wait for a minute or two to show up in your network. (ping hostname). SSH into your Raspi with username, password and hostname. Make a full system upgrade:
sudo apt update
sudo apt full-upgrade
sudo reboot now
After the update and reboot SSH into it again. Install your wanted packages, git and micro are very handy for later. Now we setup a static IP adress so we can set it up as a PiHole Use nmcli or nmtui for assigning a static IP to your Raspi. Reboot again. After reboot check if IP address is now correctly assigned with "ip a".
Setup PiHole
Go to the website and read the install section https://github.com/pi-hole/pi-hole/#one-step-automated-install
As I don't like piping directly downloaded scripts in my shell, I choose the git installation method:
Git clone...
cd <clone-folder>/automated\ install/