Page 1 of 1

Install domoticz docker on a raspberry

Posted: Wednesday 28 December 2022 17:03
by smaus
i want to install domoticz in docker on my raspberry pi4

does anyone know which docker I can use best and who knows a link how I can do this best.

thanks in advance

Re: Install domoticz docker on a raspberry

Posted: Wednesday 28 December 2022 17:17
by gizmocuz
Did you have a look on the domoticz homepage (download section)

Re: Install domoticz docker on a raspberry

Posted: Wednesday 28 December 2022 18:35
by waltervl
Or look in the Domoticz wiki, page docker

Re: Install domoticz docker on a raspberry

Posted: Wednesday 28 December 2022 20:03
by smaus
docker run -d \
-p 8080:8080 \
-p 8443:443 \
-v <path for config files>:/opt/domoticz/userdata \
-e TZ=Europe/Amsterdam
--device=<device_id> \
--name=<container name> \
domoticz/domoticz

What do i have to change on this

Re: Install domoticz docker on a raspberry

Posted: Thursday 29 December 2022 23:04
by sincze
Or a docker-compose.yml

Code: Select all

docker-compose up -d

Code: Select all

version: '2.4'

services:

  domoticz:
    container_name: domoticz
    hostname: domoticz
    restart: unless-stopped
    image: domoticz/domoticz:stable
    # Pass devices to container
    # devices:
    #   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
#       - "8025:8025"
      - "8080:8080"
      - "443:443"
    volumes:
      - ./domoticz/data:/opt/domoticz/userdata
#      - ./domoticz/data/lua:/opt/domoticz/scripts/lua
      - ./domoticz/data/scripts/lua:/opt/domoticz/scripts/lua
      - ${PWD}/domoticz/system/crontab-domoticz:/etc/crontab
    environment:
      - TZ=Europe/Amsterdam
#      - EXTRA_CMD_ARG="-www port 8025 -sslwww 8443 -wwwbind 0.0.0.0"
#      - WWW_PORT=8025
#      - SSL_PORT=8443
      #- LOG_PATH=/opt/domoticz/userdata/domoticz.log

Re: Install domoticz docker on a raspberry

Posted: Friday 30 December 2022 19:19
by sailmich
Hello I ran for years domoticz on a Rpi, because of the issue with OZW I'm trying to switch to Zwave JS UI. In the past I just used the easy way to install Domoticz but because it's recommended to make installation in Docker I try to do it. The documentation at https://hub.docker.com/r/domoticz /domoticz isn't idiot proof. Or I have problem with my Rpi3b and Bullseye lite. Domoticz event system doesn't work and I can't start a http:// script from a switch. When open event and add e.g. a dzvents script the page is empty. When try to save a script I got
2022-12-30 18:30:27.323 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Script #1.lua
First I loaded bullseye lite image and did all update/upgrade stuff.
Second installed Docker with curl.
Third installed Mqtt with docker, found a good youtube video.

Because of actual docker-compose v2 I have to remove the first row "version: '2'" in the docker-compose.yml. I also didn't do the password stuff. In docker compose v2 to start you have to use docker compose up -dAfter that mqtt was up and running:)
Fourth installed Zwave JS UI within docker, I took the docker-compose.yml from https://zwave-js.github.io/zwave-js-ui/ ... ted/docker Just commented #- SESSION_SECRET=mysupersecretkey . Zwave was up and running too:))
Fifth I installed Portainer.
Sixed I installed Domoticz with docker pull domoticz/domoticz. See my docker-compose.yml below.
Spoiler: show

Code: Select all

version: '3.3'

services:
  domoticz:
    image: domoticz/domoticz
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    devices:
    - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
      - "8080:8080"
    volumes:
       - /opt/domoticz/config:/config

    environment:
      - TZ=Europe/Berlin
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log
After hardware installation of MQTT Auto Discovery..... I got all my Zwave devices. With different Names but still there.
Would be fine if anybody could have a look into my docker-compose.yml file if something else is needed to solve my issues or could it be a problem of bullseye or docker compose version2.

Re: Install domoticz docker on a raspberry

Posted: Friday 30 December 2022 21:52
by waltervl
Best to use stable domoticz

Re: Install domoticz docker on a raspberry

Posted: Saturday 31 December 2022 7:55
by sailmich
I do docker pull domoticz/domoticz:stable in yml. Don't get ip address and puplished ports! So I can't connect in a browser. When switch back to latest beta I can connect again.
Any logs to look in? I'm not familiar with docker as I already noticed, in yml LOG_PATH=/opt/domoticz/userdata/domoticz.log, but the folder is empty.

Re: Install domoticz docker on a raspberry

Posted: Saturday 31 December 2022 11:35
by waltervl
After changing version always clear your browser cache.
Also beta uses a different domoticz.db database configuration so better to remove the database created by beta (if you are running on an almost empty database). It could be that domoticz fails to start due to this. Database should be in the opt/domoticz/userdata (and corresponding local volume) folder after starting up.

Re: Install domoticz docker on a raspberry

Posted: Saturday 31 December 2022 13:23
by smaus
Thank you all it worked. now have portrainer running with domoticz in it.

Re: Install domoticz docker on a raspberry

Posted: Saturday 31 December 2022 13:29
by sailmich
Thanks for answering! I always cleared the cache. Before I have read it, I did a set up a new image. I found somebody edited the yml file on hub docker but that is wrong! - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0" correct is without -port0. Where can I report this?
Back to my issue. With new image and docker pull domoticz/domoticz:stable I still have the problem. Later I will check your advises and come back with news.
For now I wish everybody a happy day

Re: Install domoticz docker on a raspberry

Posted: Saturday 31 December 2022 15:56
by waltervl
sailmich wrote: Saturday 31 December 2022 13:29 Thanks for answering! I always cleared the cache. Before I have read it, I did a set up a new image. I found somebody edited the yml file on hub docker but that is wrong! - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0" correct is without -port0. Where can I report this?
Back to my issue. With new image and docker pull domoticz/domoticz:stable I still have the problem. Later I will check your advises and come back with news.
For now I wish everybody a happy day
As /dev/serial/by-id/usb-0658_0200-if00 is completely dependend on your host environment this is mentioned as just an example. So no need to report this.

Docker hub install expects you to be familiar with Docker and Docker compose. It is not meant to be a monkey proof installation instruction.....