- Format your SD Card with FAT32 if <= 32GB, otherwise use exFAT
- Go to https://www.raspberrypi.org/downloads/raspberry-pi-os/ and the lite image, then unzip it
- Download https://www.balena.io/etcher/ and install it
- Use Etcher to write the downloaded image to the SD card
- Create a blank file named
ssh
into the boot partition to enable ssh with headless - Put the SD card into your Raspberry Pi, plug it into ethernet, and power it on
Check your router to see what IP the Raspberry PI was assigned - the hostname should be something like raspberrypi
. Then, SSH into it. See the docs at https://www.raspberrypi.org/documentation/linux/usage/users.md#:~:text=User%20management%20in%20Raspberry%20Pi,and%20change%20each%20user's%20password. for the default user and pass.
First things first, change the default password using passwd
sudo apt update
sudo apt full-upgrade
Add the following to /etc/dhcpcd.conf
(Note that this assumes your router is on 192.168.1.1 and you are installing pihole):
interface eth0
static ip_address=192.168.1.5/24
static routers=192.168.1.1
# static domain_name_servers=127.0.0.1
static domain_name_servers=192.168.1.1
static ip6_address=2604:2d80:4a90:8e01:6725:3263:ee41:ddff
Then, reboot your pi - sudo reboot
. When it comes back online, it should be ssh'd to via the static ip you defined above.
Config your Pi based on some preferences you have, using:
sudo raspi-config
Important settings include your localization options including locale and timezone
Run the installer:
curl -sSL https://install.pi-hole.net | bash
Follow through the prompts. Copy the password provided at the end of the install. Lets change the password:
sudo pihole -a -p
After the installer finishes, log into the web ui. Mine is located at http://192.168.1.5/admin/index.php. Click login, and get yourself familiar with the interface.
I use Cloudflare for DNS, but one thing is the installer only enables IPv4, so I am going enable IPv6 as well by going to Settings -> DNS, and selecting the IPv6 unchecked options for Cloudflare.
Also, add some good blocklists. I recommend using https://github.com/jessedp/pihole5-list-tool, as it works well. To do so:
sudo apt-get install python3-pip
sudo pip3 install pihole5-list-tool --upgrade
sudo pihole5-list-tool
This is different for every setup, but essentially you need to switch your router to use your pihole for DNS.
After the install finishes, open the UI on port 8443 of your pi. Mine is https://192.168.1.5/8443.
You can also install ntopng to forward data to your router. Install via https://packages.ntop.org/
Then follow https://www.ntop.org/ntopng/how-to-analyse-mikrotik-traffic-using-ntopng/