Run OH with Docker, how to change HTTP listening port?

Hi all,
I have OH version 2.4 running on my NAS as Docker container, I couldn’t seem to find a way to change the default HTTP listening port - I need to change it as it conflict with some other apps on the NAS. Tried to search around but couldn’t find a clear answer…

Usually, with docker, you don’t change the application ports. Instead you “publish” the inside port to a different outside one.

docker run yadda yadda yadda --publish 8080:9090 yadda yadda

Please look up the docker documentation on the “–publish” option.

While Hakan’s advise is correct, the official recommendation for the OH docker image is to use --net=host which doesn’t give you the opportunity to do the port mapping using the --publish options. But you can change the HTTP and HTTPS listening ports by defining a environment variable that you pass to the container with the -e options. See the openHAB Docker Readme for details.

Thank you both, I’m running OH in qnap’s container station which doesn’t give me all the command line options unfortunately, that’s why I was looking for a way to change port in some conf file.