{"id":18563209,"url":"https://github.com/compulim/rpi-pihole-cloudflared","last_synced_at":"2026-03-11T17:01:41.067Z","repository":{"id":82478959,"uuid":"463733561","full_name":"compulim/rpi-pihole-cloudflared","owner":"compulim","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-26T22:10:04.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T13:11:22.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compulim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-26T02:34:24.000Z","updated_at":"2024-04-26T22:10:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"19e583cd-66dc-4dbf-ba63-5e423e2f69e9","html_url":"https://github.com/compulim/rpi-pihole-cloudflared","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Frpi-pihole-cloudflared","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Frpi-pihole-cloudflared/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Frpi-pihole-cloudflared/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Frpi-pihole-cloudflared/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compulim","download_url":"https://codeload.github.com/compulim/rpi-pihole-cloudflared/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394726,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T22:12:04.820Z","updated_at":"2026-03-11T17:01:41.011Z","avatar_url":"https://github.com/compulim.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pihole-cloudflared\n\nThis will run both [Pi-hole](https://pi-hole.net/) and [`cloudflared`](https://hub.docker.com/r/cloudflare/cloudflared) at the same time.\n\n`cloudflared` uses DNS-over-HTTPS, so no one could peak into what you resolved.\n\n## Install Docker and Docker Compose\n\nNote: we will install Docker Compose from PIP3 because it is newer than `apt`.\n\n```sh\n# Install Docker\n\ncurl -sSL https://get.docker.com | sh\nsudo systemctl enable docker\nsudo systemctl start docker\nsudo usermod -aG docker pi\n\n# Install Docker Compose\n\nsudo apt update\nsudo apt install python3-pip\nsudo pip3 install docker-compose\n\n# Cache a version of cloudflared just in case if no DNS is available\n\ncd external\ncurl -LO https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb\n\n# Reboot\n\nsudo reboot\n```\n\n## Configure Pi-hole\n\nUpdate the `.env` file with corresponding settings.\n\n## Run manually\n\nRun [Pi-hole](https://pi-hole.net/) in Docker Compose.\n\n```sh\ndocker-compose up --detach\ndocker-compose logs # to see the default random password\n```\n\n### Update password\n\n```sh\ndocker-compose exec pihole pihole -a -p\n```\n\n### Test DNS server\n\nYou will need `dig` which can be installed from `dnsutils`.\n\n```sh\nsudo apt install dnsutils\n\ndig github.com @localhost\n```\n\n### Update Gravity Database\n\nAlthough Gravity Database is updated on Pi-hole start, to update-on-demand, run:\n\n```sh\ndocker-compose exec pihole pihole updateGravity\n```\n\n### Sync configuration between primary and secondary Pi-hole\n\nThere is a `sync` file which help synchronizing configuration between Pi-holes thru `scp`. Please make sure SSH keys are properly set through `~/.ssh/authorized_keys`.\n\n## Run as a service\n\nModify `pihole.service` to point to the correct directory.\n\n```sh\nchmod +x service\nsudo ln -s /home/pi/repos/pihole/pihole.service /etc/systemd/system/pihole.service\nsudo systemctl enable pihole\nsudo systemctl start pihole\n```\n\nTo update Pi-hole, modify `/etc/crontab` to reboot, or restart the Docker Compose service on a schedule. When the service is started, it will pull the latest [`pihole/pihole`](https://hub.docker.com/r/pihole/pihole) image and rebuild `cloudflared` with latest version.\n\n## References\n\n- [Pi-hole Docker image](https://github.com/pi-hole/docker-pi-hole)\n- [Configuring `cloudflared` in Pi-hole](https://docs.pi-hole.net/guides/dns/cloudflared/#configuring-cloudflared-to-run-on-startup)\n- [`cloudflared` on Docker Hub](https://hub.docker.com/r/cloudflare/cloudflared)\n- [Compose file reference v3](https://docs.docker.com/compose/compose-file/compose-file-v3/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Frpi-pihole-cloudflared","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompulim%2Frpi-pihole-cloudflared","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Frpi-pihole-cloudflared/lists"}