We did the Portainer Setup in one of the last Posts on an Raspberry Pi, so it’s Time to setup some more Container. This Post is about how to Install the Pi-hole Image with Portainer and a basic Pi-hole Setup.
Requirements
- Raspberry Pi (4B or newer)*
- Min. 4 GB Micro SD Card*
- Raspbian OS Installation with Docker and Portainer (Check out our Installation Guide here)
Naming Scheme
Before we begin – We use “pihole” as our Naming Scheme here – If you want another name (especially for your hostname), I recommend to use your custom name also for the Volume to keep things clear.
Pi-hole Provisioning
Login to Portainer first.
Volumes
Go to Menu “Volumes”, press “+ Add volume” and name it “pihole” with default Setting. Click on “Create the Volume”.

Containers
Go to Menu “Containers” – Click on “Add container” and do the following Configuration:
- Container Name: pihole
- Image Registry: DockerHub
- Image: pihole/pihole:latest

At “Manual network port publishing”: Click on “+ publish a new network port” and add these Ports:
Host Port | Container Port | Protocol |
53 | 53 | TCP |
53 | 53 | UDP |
67 | 67 | UDP |
80 | 80 | TCP |
443 | 443 | TCP |

Setup “Advanced container settings” – We start with “Volumes” – Click on “+ map additional volume”
container | volume | Hint |
/etc/pihole | pihole – local | The Volume we created before |

Still in “Advanced container settings” – Continue with Tab “Network”
- Network: Host
- Hostname: pihole

Env
Name | Value | Hint |
TZ | Europe/Berlin | Your Timezone |
WEBPASSWORD | pihole | Login Password to pihole Web UI |

Last “Advanced container setting” – Finalize with “Restart policy”: Always if you want Pi-hole started automatically.

Deploy Container

Please be patient – the Deployment may take a while. After the Deployment – Portainer will switch into the Container list View and displays the starting Container. If everything was gone right, it should be displayed as healthy:

Pi-hole Configuration
You should now be able to continue the Configuration from the Web UI. Open the hosts IP followed by /admin to login into Pi-hole:
http://your_portainer_host_ip/admin

If you configured your Environment Variables as described here, the login Password is “pihole” or the Password you decided by your own. You can now configure Pi-hole depending on your needs.
To use Pi-hole on one or more Clients, change the DNS-Server to point to your Pi-hole Installation. If you want to automatically use Pi-hole on all Clients, change the DNS Setting in your DHCP-Server to Point to Pi-hole.
*Amazon Affiliate Link