Network and DNS
How to install Pi-hole on your home server
Pi-hole blocks adverts and trackers for every device by filtering DNS. The admin page is on port 80. It has steps for Debian, TrueNAS and Proxmox.
What the steps install, and how it connects
Connects to it
- Every device on your networkonce your router points devices at it53/udp53/tcp
- Browser80/tcp
Your server, in Docker
container pihole
image pihole/
- 53/tcpDNS
- 53/udpDNS
- 80/tcpadmin page
- 443/tcpnot opened by these steps
Its data on the server
./to /etc-pihole etc/ settingspihole
On TrueNAS the app’s web page is on 20720/tcp. Drawn from step 7 of the Debian + Docker steps. Ports are the ones in those steps and in the table below.
The diagram in words
The Debian + Docker steps install the container pihole, with ports 53/tcp, 53/udp and 80/tcp; 443/tcp is not opened by these steps. Connects to it: Every device on your network (once your router points devices at it) on 53/udp and 53/tcp; Browser on 80/tcp. Its data: ./etc-pihole (settings).
What it needs
| Ports | 53/tcp, 53/udp, 80/tcp (web page), 443/tcpTrueNAS app web page: 20720/tcp |
|---|---|
| Memory | 512 MBdocs.pi-hole.net/main/prerequisites/ read 25 Nov 2026 |
| CPU | No figure. The project says Pi-hole needs little processing power.docs.pi-hole.net/main/prerequisites/ read 25 Nov 2026 |
| Disk | 2 GB free minimum, 4 GB recommendeddocs.pi-hole.net/main/prerequisites/ read 25 Nov 2026 |
| Licence | EUPL-1.2 |
| Project page | pi-hole/pi-hole |
Ports are the project's defaults. Memory and disk figures are the project's own, with the page and the date read. Estimates only.
The one thing to know before you start
Port 53 must be free on the host before you start, or Pi-hole cannot answer DNS. Keep the listening mode on ALL, because the default Docker bridge network needs it, and do not use --privileged.
Install steps
These steps follow the project's own pages and have not been tried on real hardware yet.
They start from a server that runs Docker: set up an old laptop or PC first. Docker or bare metal for Pi-hole: what each method needs.
- WARNINGDo not run these steps on a server with a public IP address. Anyone on the internet could then reach the apps.
- WARNINGDo not forward these ports on your router, unless a step tells you to. The ports would then be open to the internet.
- WARNINGDo not trust ufw to close a port that Docker opens. Docker bypasses the ufw rules. Read the Docker page on firewalls.
Debian + Docker
- WARNINGFree port 53 on the host before you start.
- WARNINGKeep FTLCONF_dns_listeningMode set to 'ALL'. Docker's default bridge network needs it.
- WARNINGDo not use --privileged. Add only the capabilities that you need.
Install Docker Engine with the Compose plugin. Use the Docker page for Debian.
Type this command to create the docker group. If the group exists, go to the next step.
sudo groupadd dockerType this command to add your user to the docker group.
sudo usermod -aG docker $USERLog out and log in again so that the group change takes effect.
Type this command to test Docker.
docker run hello-worldIf port 53 is in use, stop.
Save the compose file below as docker-compose.yml.
services: pihole: container_name: pihole image: pihole/pihole:latest ports: - "53:53/tcp" - "53:53/udp" - "80:80/tcp" environment: TZ: 'Europe/London' FTLCONF_webserver_api_password: 'change-me' FTLCONF_dns_listeningMode: 'ALL' volumes: - './etc-pihole:/etc/pihole' cap_add: - NET_ADMIN restart: unless-stoppedSet TZ to your time zone.
Replace the value of FTLCONF_webserver_api_password with your own password.
Type this command in the folder of the file.
docker compose up -dOpen http://<server address>:80 in a browser.
Type the password from FTLCONF_webserver_api_password.
TrueNAS app
checking Some details are still being checked.
- WARNINGThis app is in the stable train. iXsystems supports it.
- WARNINGUpdate TrueNAS to version 24.10.2.2 or newer before you start.
Open Apps > Discover Apps.
Apps > Discover Apps > search 'pihole' > Install (train: stable)Search for 'pihole'.
Click Install.
Open http://<server address>:20720 in a browser.
Proxmox VE (VM + Docker)
checking Some details are still being checked.
- WARNINGUse a VM, not an LXC container. Proxmox says: "nesting containers inside a Proxmox QEMU VM remains a recommended practice".
- WARNINGFree port 53 on the host before you start.
- WARNINGKeep FTLCONF_dns_listeningMode set to 'ALL'. Docker's default bridge network needs it.
- WARNINGDo not use --privileged. Add only the capabilities that you need.
Create a Debian VM in Proxmox VE.
Sign in to the VM.
Install Docker Engine with the Compose plugin. Use the Docker page for Debian.
Type this command to create the docker group. If the group exists, go to the next step.
sudo groupadd dockerType this command to add your user to the docker group.
sudo usermod -aG docker $USERLog out and log in again so that the group change takes effect.
Type this command to test Docker.
docker run hello-worldIf port 53 is in use, stop.
Save the compose file below as docker-compose.yml.
services: pihole: container_name: pihole image: pihole/pihole:latest ports: - "53:53/tcp" - "53:53/udp" - "80:80/tcp" environment: TZ: 'Europe/London' FTLCONF_webserver_api_password: 'change-me' FTLCONF_dns_listeningMode: 'ALL' volumes: - './etc-pihole:/etc/pihole' cap_add: - NET_ADMIN restart: unless-stoppedSet TZ to your time zone.
Replace the value of FTLCONF_webserver_api_password with your own password.
Type this command in the folder of the file.
docker compose up -dOpen http://<server address>:80 in a browser.
Type the password from FTLCONF_webserver_api_password.
Licences and credits: Sources and licences.
What will it cost to run?
This page gives no power figure for Pi-hole. The planner adds up the box it runs on, where the power goes splits that figure part by part, and the guide gives idle watts and a yearly cost at your own price.
Plan an ad-blocking box in the planner, or read the home server hardware guide.
Related apps
- wg-easy: a VPN on the same box
- Home Assistant: another small service for the same network