OH3 in docker

Hi @all,

as OH3 is available and I wanted since a longer time to use docker now I am giving it a try.

Hardware is a Pi 3.

Installed docker and then OH3 and node-red.

Node Red is fine and can be opened via browser. OH3 is not.

To install OH 3 I used:
sudo docker run -p 2020:2020 --name openhab3_neu_2 openhab/openhab
(tried also w/o port and with 8080:8080)

After that OH3 keeped hanging in “…Starting service…” also after having waited some hours and some reboots…

sudo docker ps -a gives:
4fa074012761 openhab/openhab “/entrypoint gosu op…” 13 hours ago Up 8 minutes (healthy) 5007/tcp, 8080/tcp, 8101/tcp,>2020/tcp, 8443/tcp openhab3_neu_2

So in docker it seems working.

In the browser I get ERR_CONNECTION_REFUSED.

Any idea on that? Tried g**le for some hours…

Kind Regrads, Dirk

Please understand Docker options any use the examples on Docker Hub as an example. That option maps port 2020 in the container to port 2020 on the host. openHAB does not use port 2020 so this option is not useful for an openHAB Docker container.

This user forum is not a replacement for reading the documentatio0n or understanding any third party software such as Docker.

Yes, I understand that docker is an option that can be used.
As I wrote I also used 8080 as port, which as far as I know is the default port.

And yes, this is a openHab forum. But as this topic is at the boarder docker forum may say the same, from there point of view. And as I established Node Red successfull it seems as if I understood docker options…

I hoped that anyone used docker for OH3 and could share the experiences. If not: please ignore the post!

Kind Regards


No idea what the problem was. Installed OH3 again using:

sudo docker run -p 8080:8080 --name openhab3 openhab/openhab

Now it works…

I have used it in testing and the configuration listed on Docker Hub works fine. You did not indicate you tried that.

docker run \
  --name openhab \
  --net=host \
  -v /etc/localtime:/etc/localtime:ro \
  -v /etc/timezone:/etc/timezone:ro \
  -v openhab_addons:/openhab/addons \
  -v openhab_conf:/openhab/conf \
  -v openhab_userdata:/openhab/userdata \
  -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Berlin" \
  -d \
  --restart=always \

Also running without volumes means the configuration is locked into the Docker container and be lost if upgrading. This forum is meant to assist after someone has issues after reading the avilable documentation.