pi-hole:setup_pi-hole_running_in_docker_and_portainer
This is an old revision of the document!
Table of Contents
Pi-Hole - Setup Pi-Hole running in Docker and Portainer
Install Docker
curl -ssl https://get.docker.com | sh
Install Portainer
This is always one of the first container to pull and run, because like me you are lazy and cannot remember more than 2 lines of code.
Create a volume to host Portainer data
docker volume create portainer_data
returns
portainer_data
Install the Portainer Docker Image
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --restart always portainer/portainer
NOTE: This will run the container to pull, install and ensure it is always running.
Check that Portainer is running
docker ps
Configure Portainer
Navigate to http://yourdeviceip:9000.
Portainer will prompt you to set up a new password for your admin user.
Connect Portainer to Docker
Install Pi-hole as a new container
Add Container
Create Container
- Name: PiHole.
- image: pihole/pihole:latest.
- Publish all exposed network ports to random host ports: Disabled. Do not publish all exposed ports. Manually do it:
- 53:53/tcp.
- 53:53/udp.
- 67:67/udp.
- 80:80/tcp
- 443:443/tcp
Map some volumes
In Advanced container settings:
- Click on the Volumes tab.
- Click map additional volume.
- Container:
- /etc/dnsmasq.d.
- Bind.
- Host:
- /home/peter/pihole/dnsmasq.d.
- Bind.
- Click map additional volume.
- Container:
- /etc/pihole/.
- Bind.
- Host:
- /home/peter/pihole/pihole.
- Bind.
NOTE: Bind mounts are used rather than standard volumes since that allows the location to the folder to be mapped instead of creating a volume in the Docker volumes folder.
pi-hole/setup_pi-hole_running_in_docker_and_portainer.1612530071.txt.gz · Last modified: 2021/02/05 13:01 by peter