This is a record of the steps that I took to install pi-hole on my raspberry pi (RPi). It might not be universally applicable. Still hopefully it can help some out there.
Precondition
- apache2 and php already installed and set up on your raspberry pi (raspbian)
Download and run the automated install (Reference)
Run this command in the terminal:
curl -sSL https://install.pi-hole.net | bash
- Select interface: wlan0 (depending on your need, wlan0 is for wifi and eth0 is for the wired connection)
- Select DNS provider: OpenDNS
- IPv4&v6: both
- Use static IP?: Yes
- Web admin interface: yes
- Install web server?: No
- Log query: On
- Privacy: full
After these steps, a message will appear in the terminal telling you the IP and the password of the admin page (something like http://192.168.x.xxx
). Note this down as you will need it later.
Two warnings
The installation finished with two warnings:
- xxx modules are missing for php
- the web server user needs to be member of the “pihole” group for full functionality
The first can be solved using
to install these packages.sudo apt install php-xxx
The second can be solved by sudo usermod -a -G pihole your_apache2_user
.
Some setup on the admin page
On the left, go to group management -> Adlists
to add custom list. Below are some that I use:
After adding your lists, go to tools -> update gravity -> update.
Check it’s working
Go to a site that you are certain that is riddled with ads or a ab backer checker site (such as this one), and you show see that most of the ads are gone!
Now, enjoy a more pleasant online experience!