I have NextCloudPi installed on RPi
it listens on 443 80 and 53
When trying to install pihole docker image with docker-compose.yml
I get the below error for each of the above mentioned ports.
I rather not messup with the nextcloud as it is in use by a number of people.
Following a Redditor advice, I changed port 443:443 to 444:443 and 80:80 to 81:80
But I still get the same error below with respect to port 53.
Nextcloud pi has a service dnsmsq that is listening on 53
Should i just change it so it is 54:53 ?? and if yes - do I then need to open external port in the router 54 and map it to internal port 53?
Thank you
ERROR: for pihole Cannot start service pihole:
driver failed programming external connectivity on endpoint pihole (fb1552a033ebd291e2e0b1246b01def25a2411f31525ca78e47f519739f90e12):
Error starting userland proxy: listen tcp4 0.0.0.0:53: bind: address already in use
ERROR: Encountered errors while bringing up the project.
It seems your RPi already runs a DNS server claiming port 53 (bind, likely).
You'd have to solve that port conflict to get Pi-hole operational.
If your Nextcloud system has no dependencies on it, the safest way would probably be to disable that other DNS server.
Thanks for coming back to me @Bucking_Horn
I'll see if I can stop the other service and assign the pihole to 53.
Currently this is how my docker-compose.yml looks like
I feel quite confused with which IPs and ports to use.
I know the RPi has its own IP and ports, and the docker machine with the pihole has its own IPs and ports
I am confused in setting these up and setting the router.
so may I please confirm two things:
In port forwarding, my router has three main parameters
device IP
external ports with start stop and
internal ports with start stop
so which device IP should I give it? Should I give it the RPI's device IP or should I work out the pihole docker machine IP and give it to the router?? can the router find the docker pihole IP even though it is on a RPi machine?
in the docker-compose.yml: can I change the 53:53/tcp 53:53/udp to 54:53/tcp 54:53/udp - and then
You do not need to (and should not) open or forward any ports on your router for Pi-hole to work properly. Opening ports exposes Pi-hole to the internet, and it is not designed to be exposed to the internet. You can easily end up with an open resolver.
No, every operating system you will use will send DNS queries on port 53.
It sounds like you're a bit new to DNS and Pi-hole and I suggest that you get Pi-hole working in a non-Docker environment first and understand how it works and how it is supposed to work first. Adding in Docker while learning the basics of Pi-hole is going to cause you unending frustration and questions.
@DanSchaper thank you very much.
This is a very intelligent answer!! I truly appreciate it.
DNS is very confusing, and trying to run nextcloudpi and pihole from the same RPi has been proving to be a nightmare for understanding how to configure the various services.
Would any of them work with pihole?
Which would be better? old unused pri 2b with 2GB or buying a new pi zero?
That device will work fine but a 2GB SD card is quite small. Just get a new 32 GB card for the Pi for about $8 US and you will have more than enough room on the card for future growth and adequate wear leveling to extend card life.