Docker ports question

Hello, so while I don’t yet have my nas, I was playing with the demo and had a question about docker ports.
image
This is where I can set my custom port right? Unlike windows jellyfin which I have to change from the web ui, with docker I have to change it here correct?

And if so, does this work for any docker image, would like to have nextcloud not use port 80. I get thats not totally jellyfin related but if someone can answer the first I hope they can answer the second.

Thanks!

Hi there,

Dockers port forwarding allows you to take any port and map it to a different number inside the container. So you can have jellyfin running on 8096 within the container but any port you want outside of the container (the “local port”) I’d imagine from your screenshot.

So you could have nextcloud running on a port other than 80 by mapping the local port to something else and keeping the container port as 80, assuming nextcloud is listening on port 80 inside the container.

Hope that clears it up

Ah, so its not actually changing the port of the app, it still reports to docker as 80 or 8096, but docker passes it on as what I set, right?

Correct the application still listens on whatever port it’s set at. Docker starts a proxy and does a translation from the “local port” on the host to the “container port” inside the container pointed at your application

You can read up more about it on the Docker documentation https://docs.docker.com/config/containers/container-networking/