this post was submitted on 29 May 2026
1 points (100.0% liked)

Docker

1453 readers
5 users here now

founded 3 years ago
MODERATORS
 

Hey guys!

I want to take the next step in selfhosting and it seems that docker is something I need for my projects.

I am running a Raspberry Pi 5 (16GB) with pihole+unbound and I want to install NextCloud as well. The problem is: NextCloud and PiHole both want to use port 80, which conflicts.

So, I probably need to remap the ports with docker. I already saw some videos and read some instructions, but so far I had no success setting it up. It's pretty confusing, with no docker-experience.

How do you handle this issue? Maybe I just need a little push in the right direction.

~sp3ctre

top 5 comments
sorted by: hot top controversial new old
[–] ExperimentalGuy@programming.dev 0 points 2 weeks ago

Would a reverse proxy be a solution? I haven't done that type of thing in a while but maybe you could map different services to different subdomains and just route that way?

[–] HumbleBragger@piefed.social 0 points 2 weeks ago (1 children)

In your compose file, in ports, just set the first number to the port number you wanna use. I use 8088 for my nextcloud for instance. The second number is the number the docker container is set to use internally. So you can just set like 8088:80 in your compose file. That should do the trick.

[–] sp3ctre@feddit.org 0 points 2 weeks ago* (last edited 2 weeks ago)

Sounds great!

Can you provide your compose-file? I feel like I need a correct and up-to-date setup to properly understand it.

Is PiHole, Unbound and NextCloud running in the same compose file and are you using different networks in it?

[–] slazer2au@lemmy.world 0 points 2 weeks ago

Toss a reverse proxy in front like Traefik and that way any docker container can overlap however it wants.

[–] sylver_dragon@lemmy.world 0 points 2 weeks ago

One of the traditional ways to do this is to stand up a reverse proxy (e.g. NGinx) That then sits on ports 80 and 443 (you'll want TLS for NextCloud) and forwards traffic to those applications. If you are using docker for everything, you can have a back-end docker network where the NGinx container forwards traffic to the PiHole and NextCloud containers. And since each container is its own entity, you don't need to worry about mucking about with the ports for the different services, they can each have ports 80/443 on their own container and you don't need to worry about forwarding those ports from the host. Though, if PiHole is running on the hardware and not in a container, this can complicate things.