Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 2.65 KB

README.md

File metadata and controls

54 lines (35 loc) · 2.65 KB

Pi-Hole w/ Lets Encrypt and DNS over HTTPS using Docker-Compose

In the name of science and security, this project builds off this popular article for setting up Pi-Hole to use DNS over HTTPS. I have added changes to allow the admin interface to run over HTTPS with a Lets Encrypt cert, utilizing docker volumes for persistent storage, and other minor changes.

Setup & Installation

0. Prerequistes

The following items must be met:

  • Install Git, Docker & Docker-Compose
  • A Let's Encrypt Compatibale DNS provider

1. Clone the Repo

git clone https://github.com/SoarinFerret/pihole-doh-letsencrypt.git
cd pihole-doh-letsencrypt

2. Copy and Edit the necessary files

Any file with a .default name will need to be renamed and modified. The files you will create are:

  • .env
  • external.conf
  • le-domains.conf

2.1 .env

  • PIHOLE_TAG is the tag to be used for the pihole docker container. See available list here.
  • LE_TAG is the tag to be used by the lets-encrypt container. See availble list here.
  • ADMIN_PASSWORD is the admin password to be used by Pi-Hole. random will produce a random output that can be found in the docker-compose logs.
  • IP_ADDR is the IP address of your server. Because ubuntu uses systemd-resolvd, localhost:53 is in use by the OS. By defining the IP, we get around this limitation.
  • EMAIL is the email to receive notification from Lets Encrypt.
  • CF_USER is your CloudFlare username. This will need to be changed if not using Cloudflare.
  • CF_TOKEN is your Cloudflare API token. This will need to be changed if not using Cloudflare.
  • LE_STAGING defines whether or not to use the LE staging. This is useful for testing functionality.

2.2 external.conf

Simply change the first line from pihole.example.com to whatever the URL you will be using to access the server.

2.3 le-domains.conf

Simply change the first line from pihole.example.com to whatever the URL you will be using to access the server.

Reference Links:

Special thanks to Jan Collijs for providing the cloudflared image and for my initial docker-compose.yml file.