New Domoticz instance in Docker how to add new Themes Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
User avatar
Ragdag
Posts: 152
Joined: Friday 30 March 2018 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

New Domoticz instance in Docker how to add new Themes

Post by Ragdag »

I'm in the process of setting up a new Domoticz instance using Docker, and so far everything is working well — including Z-Wave JS, MQTT, P1 USB, etc.

The only issue I’m still trying to solve is how to restore the Machinon theme.
On my old (non-Docker) setup, I simply placed the theme folder under www/styles, but I can't find that path in the new setup.

Here is my current docker-compose.yml:

Code: Select all

services:
  domoticz:
    container_name: domoticz
    image: domoticz/domoticz:latest
    restart: unless-stopped
    ports:
      - 8080:8080
      - 6144:6144
      - 1443:1443
    volumes:
      - ./config:/opt/domoticz/userdata
    devices:
      - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A15Z54NR-if00-port0:/dev/ttyUSB0
networks: {}
This creates the expected files and folders (e.g., the database) under:

Code: Select all

/home/user/docker/stacks/domoticz/config/
However, there is no "www/styles/" directory like in my previous install, so I’m unsure where or how to place the machinon theme files.
I only see a "www/templates/"

What am I missing?
Do I need to mount an additional volume to access the web root, or is the theme approach different in the Docker image?

Thanks in advance for your help!
User avatar
Ragdag
Posts: 152
Joined: Friday 30 March 2018 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: New Domoticz instance in Docker how to add new Themes

Post by Ragdag »

Update:

I’ve figured it out — posting here in case it helps someone else.

At first, I tried mounting the entire styles and templates directories:

Code: Select all

services:
  domoticz:
    container_name: domoticz
    image: domoticz/domoticz:latest
    restart: unless-stopped
    ports:
      - 8080:8080
      - 6144:6144
      - 1443:1443
    volumes:
      - ./config:/opt/domoticz/userdata
      - ./config/www/templates:/opt/domoticz/www/templates
      - ./config/www/styles:/opt/domoticz/www/styles
    devices:
      - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A15Z54NR-if00-port0:/dev/ttyUSB0
networks: {}
With this setup, I was able to add the machinon theme and select it in the UI. However, this approach overwrites all the built-in default themes, making them unavailable.

Final working solution:
Instead of mounting the entire styles folder, I now only mount the custom style subfolder directly:

Code: Select all

services:
  domoticz:
    container_name: domoticz
    image: domoticz/domoticz:latest
    restart: unless-stopped
    ports:
      - 8080:8080
      - 6144:6144
      - 1443:1443
    volumes:
      - ./config:/opt/domoticz/userdata
      - ./config/www/templates:/opt/domoticz/www/templates
      - ./config/www/styles/machinon:/opt/domoticz/www/styles/machinon
    devices:
      - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A15Z54NR-if00-port0:/dev/ttyUSB0
networks: {}
Now the machinon theme works perfectly and all default themes remain available.

Hope this helps!
User avatar
waltervl
Posts: 5847
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: New Domoticz instance in Docker how to add new Themes

Post by waltervl »

Thanks!
I added this tip to the tips and tricks section of the Docker wiki: https://wiki.domoticz.com/Docker
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest