Table of Contents

Hardware components you need

  1. A Raspberry Pi Model 3 B+ or greater (I am using Model 3 B+) with a 32 GB SD-Card (must be atleast 8 GB)
  2. A power cable
  3. A PC/Laptop to set it all

Setup your Raspberry Pi

  1. Download Raspbian img of your choice (I will be installing Raspbian Lite OS because I don’t need any graphical tools)
  2. Write the img in the SD-Card using imager or any other burner of your choice

Raspberry Pi Imager v1.5

  1. After successfully burning the image, you need to create and place two files in the /boot directory on the SD-Card

boot

Files

  • ssh - it will allow ssh login on boot.
  • wpa_supplicant.conf - it will help connect with the Wifi, copy the following information in the file (change country,ssid, and psk values).
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=COUNTRY-CODE

network={
 ssid="YOUR-WIFI-NAME"
 psk="WIFI-PASSWORD"
}

Commands to create these files

These commands work both on Windows and Linux

  • To create ssh file, type the command echo 0>ssh
  • To create this file, type echo 0>wpa_supplicant.conf

Note: ssh file is empty with no extentions, and wpa_supplicant file should contain the above information and have .conf extention.

  1. After copying the files, eject the SD-Card and plug it in the Raspberry Pi, and plug in the power cable.
  2. Wait for 90 seconds at least for the raspberry pi to boot, after that find the IP address of the Raspberry Pi from the home routers web interface.

ip-address

Tip: If your home router does not show the hostname of the device, you can take the listed MAC addresses one by one and use https://macvendors.com/ to find out which device is your Raspberry Pi.

  1. SSH into the device using default credentials ssh pi@IP_ADDRESS and raspberry (username:pi, password:raspberry)

ssh

  1. Update login password, hostname, wifi settings, or any other setting you want to change with sudo raspi-config and run sudo apt update && sudo apt upgrade after that, and restart the device with sudo shutdown -r after secussfully updating the packages.

raspi-config

update

Setup Pi-hole

  1. Get Pi-hole and run the setup, it will prompt for some configurations (default configurations are just fine or you can change according to your needs) and than install the Pi-hole.

pi-install

You should note the Web Interface link and the password it has given at the end of the installation.

Pi-hole is now installed, it is that easy!

dashboard

Post Install

  1. If you have used wlan0 interface instead of eth0 (used wifi instead of ethernet), you should change the interface to ‘Listen on all interfaces’ intead of ‘Listen only on interface eth0’.

interface

  1. Now, you have to give a static IP address to the raspberry-pi and set that IP address as DNS server from the home router. Home routers can assign static IP but not all of them have an option to change the DNS IP.

static-ip

  1. If your home router does not have an option to change DNS server, you can manually configure the DNS IP for your devices.

dns

For Android device, there is an application named ‘DnsChanger’ which is quite good and easy to use.

  1. Read Pi-hole documentations for more guidence on changing DNS server if your home router doesn’t have an option to do so.

Troubleshooting

  1. If there is some problem with the installation of the Pi-hole, sudo apt update && sudo apt upgrade the system before installing it.
  2. If there are some issues with the services (lighttpd, pihole-FTL), try to look for already running services that might be interupting, change the ports on which they listens, and you are good to go.
  3. If you have any query, feel free to comment it down, I will try to help if I can.