{"id":15148433,"url":"https://github.com/freekers/automated-pihole","last_synced_at":"2025-09-29T17:31:49.932Z","repository":{"id":132626375,"uuid":"190730077","full_name":"Freekers/automated-pihole","owner":"Freekers","description":"Automated Self-Updating (Public) Pi-hole Stack using unbound as recursive DNS server with Ansible","archived":true,"fork":false,"pushed_at":"2020-06-07T20:06:19.000Z","size":74,"stargazers_count":59,"open_issues_count":3,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-26T13:03:41.494Z","etag":null,"topics":["ansible-playbook","docker","pi-hole","unbound"],"latest_commit_sha":null,"homepage":"https://public-pihole.com","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freekers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-06-07T11:05:04.000Z","updated_at":"2024-09-15T07:06:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7ee93e3-ecd6-45c7-8e4e-84ca556e0098","html_url":"https://github.com/Freekers/automated-pihole","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/Freekers%2Fautomated-pihole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freekers%2Fautomated-pihole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freekers%2Fautomated-pihole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freekers%2Fautomated-pihole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freekers","download_url":"https://codeload.github.com/Freekers/automated-pihole/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874649,"owners_count":16554606,"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":["ansible-playbook","docker","pi-hole","unbound"],"created_at":"2024-09-26T13:03:45.886Z","updated_at":"2025-09-29T17:31:44.636Z","avatar_url":"https://github.com/Freekers.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"⚠️⚠️⚠️ ***Please note: This playbook has been deprecated in favor of [ansible-adguard](https://github.com/Freekers/ansible-adguard)*** ⚠️⚠️⚠️\n\n\n## Automated, self-updating, Pi-hole stack using unbound as recursive DNS server\n\nThis Ansible playbook installs a self updating Pi-hole stack from scratch:\n- You can choose between a Public Pi-hole or a Personal/Private one\n- Both use unbound as recursive DNS server instead of public upstream DNS servers\n- Both deploy (by default) the uber adlist/blocklist by OISD.nl  \n- Both add my (auto-updated) whitelist for your websurfing convenience\n- If deploying a public Pi-hole, it includes LetsEncrypt to secure the admin interface with valid certificate over HTTPS\n- If deploying a public Pi-hole, basic protection against DNS Amplification, SSH and bruteforce attacks is included using fail2ban\n- The entire stack is based on Docker (so OpenVZ VPSes are NOT supported)\n\nTested on Ubuntu Server 18.04.2 LTS (Minimal) with Ansible 2.8 on Scaleway.com\n\n## Proposed Usecase\nI designed this playbook for my own personal usecase and decided to make it public for those of you who have the same usecase and/or want to (re)use specific parts from my playbook.  \nI'm willing to learn how to make this playbook more robust and generic. Therefore I am accepting pull requests :)  \nI highly recommend checking the playbook before running so that you know what will be installed etc.\n\n## Remarks for Public installation\n- **Please do not set up a PUBLIC Pi-hole if you don't know what you're doing**. You risk getting in all sorts of trouble. Most ISPs don't allow a public DNS resolver on their networks and will shut you down without notice. Why? [Because it's generally a bad idea.](https://community.infoblox.com/t5/Community-Blog/How-Dangerous-Can-An-Open-DNS-Resolver-Be-Part-I/ba-p/4017) **You have been warned.**\n- Make sure to add an A (and if applicable, AAAA) record for your Pi-hole's hostname in your domainname's DNS, pointing to the IP address of your server.\n- If certificate generation fails, [click here for troubleshooting steps](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/wiki/Invalid-authorizations) \n\n## Installation Instructions\n1. [Install Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-releases-via-apt-ubuntu)\n2. Clone repository using `git clone https://github.com/Freekers/automated-pihole.git`\n3. Edit `hosts` and `.env` file to reflect your setup, i.e. change domains, IP etc. \n`playbook.yml` does NOT need to be changed!\n4. Install required roles from Ansible Galaxy roles using `ansible-galaxy install -r requirements.yml`\n5. Start playbook using `ansible-playbook playbook.yml --ask-become-pass`  \nWhen running the playbook on a remote target/server, make sure to copy your SSH key to remote target/server first (before running the playbook) using `ssh-copy-id`\n\n## Usage Instructions\nOnce everything has been installed, you can use regular docker and docker-compose commands to stop/start/restart containers.  \nThe `docker-compose.yml` file will be located at `/opt/automated-pihole` after installation.\n\n## Uninstallation Instructions\n1. `sudo docker-compose -f /opt/automated-pihole/docker-compose.yml down`\n2. `rm -rf /opt/automated-pihole`\n3. Consult playbook.yml to manually review packages \u0026 firewall rules that are no longer needed\n\n## Disclaimer\n- Even though this playbook configures and automatic updating Pi-hole, the Pi-Hole developers specifically have not included an auto-update option. It is best to read the release notes and determine if an update is appropriate for you, prior to updating. Sometimes updates can introduce breaking changes requiring manual intervention, such as editing/updating the docker-compose file. Therefore always keep an eye on the release notes.\n- This playbook/script/repository is 100% unofficial and NOT affiliated with, funded, endorsed, or in any way associated with [Pi-hole.](https://pi-hole.net/)\n\n## Acknowledgements\n- [Pi-hole](https://hub.docker.com/r/pihole/pihole/) Docker image by Pi-hole\n- [ouroboros](https://github.com/pyouroboros/ouroboros) Docker image by pyouroboros\n- [unbound](https://github.com/obi12341/docker-unbound) Docker image by obi12341\n- [nginx-proxy](https://github.com/jwilder/nginx-proxy) Docker image by jwilder\n- [letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) Docker image by JrCs\n- [Unattended-Upgrades](https://github.com/jnv/ansible-role-unattended-upgrades#unattended-upgrades-role-for-ansible) Role for Ansible by jnv\n- [Docker](https://github.com/geerlingguy/ansible-role-docker) Role for Ansible by geerlingguy\n- [pihole-fail2ban](https://github.com/goncalopereira/pihole-fail2ban) by goncalopereira\n- [dbl.oisd.nl](https://dbl.oisd.nl) blocklist by [sjhgvr](https://www.reddit.com/user/sjhgvr)\n- [Commonly white listed domains for Pi-Hole](https://github.com/Freekers/whitelist) by anudeepND \u0026 Freekers\n- [Unbound configuration file for Pi-hole](https://docs.pi-hole.net/guides/unbound/) by Pi-hole\n\n## License\nUnless otherwise specified, all code is released under the GNU General Public License v3.0. See the [repository's `LICENSE` file](https://github.com/Freekers/automated-pihole/blob/master/LICENSE) for details.\n\n### Licenses for other components\n- Docker: [Apache 2.0](https://github.com/docker/docker/blob/master/LICENSE)\n- Ansible: [GNU 3.0](https://github.com/ansible/ansible/blob/devel/COPYING)\n- Pi-hole: [EUPL 1.2](https://github.com/pi-hole/pi-hole/blob/master/LICENSE)\n- ouroboros: [MIT](https://github.com/pyouroboros/ouroboros/blob/master/LICENSE)\n- unbound: [Apache 2.0](https://github.com/obi12341/docker-unbound/blob/master/LICENSE)\n- nginx-proxy: [MIT](https://github.com/jwilder/nginx-proxy/blob/master/LICENSE)\n- letsencrypt-nginx-proxy-companion: [MIT](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/blob/master/LICENSE)\n- Unattended-Upgrades: [GPL 2.0](https://github.com/jnv/ansible-role-unattended-upgrades/blob/master/LICENSE)\n- Ansible Role - Docker: [MIT](https://github.com/geerlingguy/ansible-role-docker/blob/master/LICENSE)\n- whitelist: [MIT](https://github.com/Freekers/whitelist/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreekers%2Fautomated-pihole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreekers%2Fautomated-pihole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreekers%2Fautomated-pihole/lists"}