Skip to content

Instantly share code, notes, and snippets.

@evgkarasev
Forked from ridingintraffic/install pihole
Created March 7, 2019 13:46
Show Gist options
  • Save evgkarasev/a2b664b84e5a4533bc969535066584b8 to your computer and use it in GitHub Desktop.
Save evgkarasev/a2b664b84e5a4533bc969535066584b8 to your computer and use it in GitHub Desktop.
recipe for pihole
PI install (scroll down for docker)
1. install raspbian lite
2. setup ssh
3. change hostname
4. set static ip on router, see why you changed the hostname now ;)
5. $ curl -sSL https://install.pi-hole.net | bash
6. follow the prompts and get everything turned on.
- set upstream DNS, google 8.8.8.8 or cloudflare 1.1.1.1
- use ipv4, ipv6 comes later
- enable the webinterface, we can script later
- install will take a while but "Constant vigilance!" otherwise you'll miss the last screen
!! pay attention to the last screen if you enabled the admin web page, it will give oyu the password
when you miss that page, ssh into the pihole and reset the password for the admin page with
$ pihole -a -p
Enter New Password (Blank for no password):
7. setup your laptop to use the dns server ip of the pi hole
OR
7.setup your router to use the dns server ip of the pi hole done
wait! there is a docker version ( out of the box it will only run on a linux or arm docker host sorry mac)
1. git clone https://github.com/pi-hole/docker-pi-hole/
2. docker pull pihole/pihole:latest
3. sudo service systemd-resolved stop
## ubuntu has a resolver service running and we will need ot nuke that so we can run our own dns on port 53
4. cd docker-pi-hole
5. ./docker-run.sh
6. docker logs -f $(docker ps --filter "name=pihole" --format "{{.ID}}") # lets tail some logs
7. docker logs --since 1h $(docker ps --filter "name=pihole" --format "{{.ID}}") | grep "Assigning random password" ## as long as you started the container less than an hour ago, we have the password
7a. # no password no problem #
$ docker exec -i -t $(docker ps --filter "name=pihole" --format "{{.ID}}") /bin/bash <enter>
root@1234:/ pihole -a -p <enter>
Enter New Password (Blank for no password): "5up3r53kr37"
8. setup your laptop to use the dns server ip of the pihole
OR
8.setup your router to use the dns server ip of the pihole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment