Pi hole - vincios/rpi-setup GitHub Wiki

Overview

The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software.

Note

Since Pihole v6 the web server is directly embedded into the pihole-FTL binary. This eliminates the need for lighttpd/nginx and PHP.

The web server configuration for old v5 is still in the legacy wiki.

Install Pi-hole

  1. Make sure that your system is fully updated (with apt)

  2. Install Pi-hole

    $ curl -sSL https://install.pi-hole.net | bash

    ⚠️ Make note of the admin password

  3. Change the http port to 8088

    $ sudo pihole-FTL --config webserver.port "8088o,8443os,[::]:8088o,[::]:8443os"
  4. Install whitelist

Caution

⚠️ Maybe deprecated?

```bash
$ git clone https://github.com/anudeepND/whitelist.git
$ sudo python3 whitelist/scripts/whitelist.py
  ```

Notes:

  • Current block lists are taken from here.

Traefik configuration

  • Follow Annex: Add custom dynamic configuration, use the following configuration:

    ✨ Click to see the code
    http:
      routers:
        pi-hole:
          rule: Host(`pihole.{{ env "DUCKDNS_DOMAIN"}}.duckdns.org`)
          service: "pi-hole"
    
          # Middlewares to which the request will be forwarded when the route is activated
          # Optional
          middlewares:
            - redirect-to-admin
            - authentication
    
          # Enable the TLS encryption
          # Normally, you should not need to edit this section
          tls:
            certResolver: "duckdnsResolver"
            domains:
              - main: "{{ env "DUCKDNS_DOMAIN"}}.duckdns.org"
                sans:
                  - "*.{{ env "DUCKDNS_DOMAIN"}}.duckdns.org"
    
      middlewares:
        redirect-to-admin:
          redirectRegex:
            regex: "^https://([^/]+)/?$"
            replacement: "https://${1}/admin/"
    
      # Service's urls where the request will be forwarded
      services:
        pi-hole:
          loadBalancer:
            servers:
            - url: "http://127.0.0.1:8088/admin/"

Update

$ sudo pihole -up
⚠️ **GitHub.com Fallback** ⚠️