Sharing my Docker Compose setup for Home Assistant, InfluxDB, and Grafana

Hey All,

It took me a while to piece it together since I couldn't find this stack readily available in one compose file, so I wanted to share it with the community.

I did a full write-up here with more details about how to set it up and link it together in the GUI.

I'm running it on Proxmox VM on a Debian 12 OS, and it's been rock solid for over a year.

services:
  homeassistant:
    container_name: homeassistant
    image: 
    volumes:
      - home-assistant:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: false
    network_mode: host

  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto:latest
    restart: unless-stopped
    ports:
      - "1883:1883"
    command: "mosquitto -c /mosquitto-no-auth.conf"
    volumes:
      - mosquitto:/mosquitto/data

  node-red:
    container_name: nodered
    image: nodered/node-red:latest
    restart: unless-stopped
    environment:
      - TZ=America/Los_Angeles
    ports:
      - "1880:1880"
    volumes:
      - nodered:/data

  zigbee2mqtt:
    container_name: zigbee2mqtt
    restart: unless-stopped
    image: koenkk/zigbee2mqtt
    volumes:
      - zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - "8080:8080"
    environment:
      - TZ=America/Los_Angeles
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB1

  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=<create your own unique session ID> 
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      # Uncomment if you want log times and dates to match your timezone instead of UTC
      # Available at 
      - TZ=America/Los_Angeles
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D054242-if00:/dev/zwave'
      # run this command: ls -l /dev/serial/by-id/*
    volumes:
      - zwavejsui:/usr/src/app/store
    ports:
      - "8091:8091" # port for web interface
      - "3000:3000" # port for Z-Wave JS websocket server

  influxdb:
    container_name: influxdb
    image: influxdb:2
    restart: unless-stopped
    volumes:
      - influxdb-data:/var/lib/influxdb2
      - influxdb-config:/etc/influxdb2
    environment:
      - name=value
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=homeassistant
      - DOCKER_INFLUXDB_INIT_PASSWORD=<create your own unique pw>
      - DOCKER_INFLUXDB_INIT_ORG=homeassistant
      - DOCKER_INFLUXDB_INIT_BUCKET=homeassistant
    ports:
      - "8086:8086"

  grafana:
    container_name: grafana
    image: grafana/grafana:latest
    restart: unless-stopped
    volumes: 
      - grafana:/var/lib/grafana
    depends_on:
      - influxdb
    ports:
      - "3030:3000"

volumes:
  home-assistant:
  nodered:
  zigbee2mqtt:
  zwavejsui:
  mosquitto:
  influxdb-data:
  influxdb-config:
  grafana:

Edit: removed port 9001 from mosquitto since websocket support was not needed