Skip to content

Commit

Permalink
update draft for pi-hole installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mloning committed Apr 27, 2024
1 parent a21831c commit 76baf74
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions content/posts/setting-up-pihole-on-raspberry-pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ I've finally had some time to set up [Pi-hole] on my [Raspberry Pi].

For most parts, I followed the excellent [tutorial] on the Raspberry Pi website.

## Initial setup

## Set up Raspberry Pi

1. On your usual computer, install an operating system on the microSD card. I used the [Raspberry Pi Imager](https://www.raspberrypi.com/documentation/computers/getting-started.html#install-an-operating-system). Make sure to configure the user account (username, password), WiFi settings, and host name.
1. Insert microSD card into the Raspberry Pi.
1. Wait for the Raspberry Pi to boot.
1. Connect using ssh using the user account configured in step 1: `ssh <user>@<host>.local`, for example: `mloning@raspberrypi.local`.
1. On the Raspberry Pi, upgrade the system packages and restart: `sudo apt-get update && sudo apt-get upgrade --yes && sudo reboot`.

A few useful commands:

* `sudo shutdown -h now` to shut down. To start it again, re-connect the power cable.
* `sudo reboot` to restart.

## Easier login with ssh key

Optionally, for an easier login experience, you can use an ssh key:
Expand Down Expand Up @@ -50,20 +54,32 @@ To connect to your Raspberry Pi from your usual computer, you should now be able

On the Raspberry Pi:

1. Install Pi-hole: `curl -sSL https://install.pi-hole.net | bash`. Make a note of the IP address and admin password for the dashboard (or store it in your password manager).
1. To install Pi-hole, run: `curl -sSL https://install.pi-hole.net | bash`. In the [tutorial], the Raspberry Pi is connected via WiFi, with the `wlan0` interface being configured in the installation. If you can connect via an Ethernet cable, that's usually the preferred choice as it's more reliable, using `eth0` for the interface.
1. Make a note of the IP address and admin password for the dashboard (or store it in your password manager).

To check if Pi-hole is running, try:

* `pihole status`
* `pihole -c` to open the console dashboard,
* opening `http://<host>/admin/` (for example, `http://raspberrypi.local/admin/`) in the browser of your usual computer to login to the admin dashboard using the admin password.

## Configure Pi-hole as your network's DNS server
If you want to reconfigure Pi-hole later, run: `pihole -r` and select "reconfigure".

## Configure Pi-hole as your network's DHCP provider

My router did not allow me to set a DNS server, so I configured the DHCP provider instead.
For other options, see the [tutorial].

1. Log in to your router's admin page. If you don't know the address, you can find it using: `nmcli -f IP4.GATEWAY device show wlan0`
Log in to your router's admin page. If you don't know the address, you can find it using: `nmcli -f IP4.GATEWAY device show wlan0`, assuming your usual computer is connected via `wlan0` and not `eth0`.

From your router's admin page:

1. Assign a static IP to the Raspberry Pi.
1. Disable your router's default DHCP provider.

From the Pi-hole admin dashboard:

1. Enable Pi-hole as the DHCP provider in "settings" under "DHCP".

## Check if Pi-hole is working

Expand Down

0 comments on commit 76baf74

Please sign in to comment.