Zigbee2mqtt dockerized on Raspberry OS

July 12th, 2026

CAUTION This is a cheat-sheet for a fast startup. Security requirements are not considered here. If you follow the instructions, apps will be available from outside of the host without even any password protection! You have been warned.

Install Docker

Install mosquitto

1
2
3
4
5
persistence true # CAUTION - consider persistence
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
allow_anonymous true # CAUTION - make sure you really want it
listener 1883 0.0.0.0
1
2
3
4
5
6
7
8
docker run --rm \
--name mosquitto \
-p 1883:1883 \
-v MQTT_CONFIG_DIR:/mosquitto/config \
-v MQTT_DATA_DIR:/mosquitto/data \
-v MQTT_LOG_DIR:/mosquitto/log \
--network YOUR_NETWORK \
eclipse-mosquitto

Install zigbee2mqtt

1
2
3
4
5
6
7
8
9
docker run --rm \
--name zigbee2mqtt \
-p 8080:8080 \
-v ZIGBEE2MQTT_DATA_DIR:/app/data \
-v /run/udev:/run/udev:ro \
--device=/dev/ttyUSB0 \
--network YOUR_NETWORK \
-e TZ=Europe/Amsterdam \
ghcr.io/koenkk/zigbee2mqtt

Final commands for automatic mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
docker run -d \ # daemon
-i \ # interactive mode
--restart unless-stopped \ # auto-restart, manual stop takes precedence
--name mosquitto \
-p 1883:1883 \
-v MQTT_CONFIG_DIR:/mosquitto/config \
-v MQTT_DATA_DIR:/mosquitto/data \
-v MQTT_LOG_DIR:/mosquitto/log \
--network YOUR_NETWORK \
eclipse-mosquitto
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
docker run -d \ # daemon
-i \ # interactive mode
--restart unless-stopped \
--name zigbee2mqtt -p 8080:8080 \
-v ZIGBEE2MQTT_DATA_DIR:/app/data \
-v /run/udev:/run/udev:ro \
--device=/dev/serial/by-id/XXXXX \ # unique identification of the device
--network YOUR_NETWORK \
-e TZ=Europe/Amsterdam \
ghcr.io/koenkk/zigbee2mqtt

Next: InfluxDB3 on Raspberry Pi / jemalloc: Unsupported system page size

Previous: Search for a host with no tools on Windows

Main Menu