Upgrade z2mqtt from an old version (1.16.1) to the latest version

Is it possible to upgrade to the latest version of z2mqtt from my version 1.16.1 to the latest one available by following the steps in the documentation, can someone help me?

I’m not sure, but you can always take a quick look through the releases for any breaking changes.

edit: I can see that 1.16,1 was released on Nov, 2020 so quite a while ago. I guess you can always back everything up incase something goes wrong? You might also want to check the firmware on your Zigbee stick.

Hi, thanks for the help.

But my question is the following, the procedure that the documentation shows, I think that in some of the versions it changes and with my version it is not possible to continue as the manual says. That’s why I’m interested in knowing how I can update, I think the problem comes from the version of NODE that a minimum is needed that I currently don’t have…


OK, got it, I thought by your original question (above) you only wanted to know if it would work.

If you are running it in docker you need to pull the latest version.
How is it installed?

I have it installed and working on direct linux installation and I have read on the web that with the documentation commands it does not update correctly, due to something related to the NODE version.

The problem is that I have the outdated version because I didn’t need more, I was in a different house and now I want to connect a new device that will not be compatible, so I want to update it to the latest version to be able to integrate more devices.


But the idea is to be able to install it without losing what it might have, in order to be able to test if it works and if not go back to the previous thing. Perhaps, I could build a DOCKER with the latest version and stop the current service… I don’t know, I don’t understand what options I can have???

Perhaps ask this question on the Z2M GitHub pages?

I have been very happy running Zigbee2MQTT in a docker container for 5+ years now. 1st on a Raspberry Pi 3 and then moved to a old Intel Mac running Linux with Zigbee2Mqtt in docker container. Now I am using Proxmox to do the same.

I would highly recommend taking the time to learn a little Docker and setup a minimum Docker environment with Portainer, Mosquitto MQTT server and Zigbee2MQTT. If you can get comfortable with that setup, I am fairly sure you can get your current version running in a docker container. Here shows how good the history of Zigbee2Mqtt docker containers are, your version is still there:

You will have to take some time to learn now to get your Zigbee dongle visible to the docker container. That is an important task and item to keep in your quiver of knowledge. The benefits of have each of these running in their own private capsule is so very strong!

Once you understand how to get your current version of Zigbee2mqtt running in a docker container with it’s zigbee dongle functioning. You can copy your zigbee2mqtt config directory to the place that is visible to the zigbee2mqtt docker container and get it running.

If it does not work, just shut down the zigbee2mqtt docker container, move the dongle back to your current setup, get it back running. The have :wine_glass: &| :beer: and navel gaze on what went wrong. Getting your MQTT environment move is another task, but optional if your current MQTT setup is working okay.

Once you have your current zigbee2mqtt version running in an isolated docker container, it is so very easy to shut down your current version, download the docker container for a newer version and fire it up. If you have issues, just shutdown the newer docker container and restart the current successfully running container and then again navel gaze on what the issues are.

Trying to integrate complex combinations of support tools for a complex app like zigbee2mqtt on your host linux system (or even within Home Assistant) is a recipe for pain. Docker isolates everything, all these required components (Node, HTML servers, Python, Linux, scripts kitchen sink), and amazing and useful tool have in your tool box.

Below is and example of all it takes me to upgrade to a new version of zigbee2mqtt:

  1. shutdown current docker contain.
  2. backup zigbee2mqtt conf directory for CYA.
  3. execute the following docker command:
docker run -i -t -d \
   --name="production-zigbee2mqtt-1.31.2" \
   -v /home/user/zigbee2mqtt/zigbee2mqtt-data:/app/data \
   -v /run/udev:/run/udev:ro \
   --device=/dev/serial/by-id/usb-1a86_TubesZB_971207DO-if00-port0 \
   --user 1000:1000 \
   --group-add dialout \
   --net=host \
   -e TZ=America/Los_Angeles \
  1. check the zigbee2mqtt logs.
  2. verify operation of devices in Home Assistant.

You should be able to march thru an upgrade to the current version of zigbee2mqtt at a pace you can handle, you go by the 1.x.(last) steps or skip a few if you feel confident. However, again, backing down has never been a problem for me.

On a side note, I highly recommend NOT upgrading any firmware in the zigbee dongle until after you get to a zigbee2mqtt version you are happy with. And then wait a couple weeks at least. Mixing upgrades of zigbee2mqtt and zigbee firmware at the same time in another one of those danger zones that there is not reason to get into. I have used ancient version of zigbee dongle firmware with no issues. Unless you paint yourself into a corner by introducing a problematic device to your network, the chance of a problem from your current dongle firmware (if your current version is running fine) is so very small. as part of this, again don’t change devices in your zigbee network while getting your zigbee2mqtt version to your happy place. Mixing device changes, firmware changes and zigbee2mqtt versionall at same time is really not a good idea.

Good hunting!

What version of node.js are you on ?

If it helps, here’s my equivalent docker-compose file for Z2M:

name: "smarthome"
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:1.31.2
      - ./zigbee2mqtt-data:/app/data
      - /run/udev:/run/udev:ro        # auto-detects port & some adapters eg ConBee
      - TZ=Europe/London
      - /dev/ttyUSB0:/dev/ttyUSB0     # must match your adapter location
    ports:                            # needed if network_mode is not 'host'
      - 8080:8080                     
    restart: unless-stopped

With this, the docker command to get the new image is:

docker compose pull

And then, the command to create the container is:

docker compose up -d

Well, over time, I have upgraded from version 1.01 to the current version, changed coordinator from CC2531 → CC530 + ESP → CC2530 + CC2591 + ESP → CC2652 + Ethernet, and moved from Pi1 to P2 to Pi4, from jessie to buster to bullseye, all without any problems, running Linux install.

OK! Thank´s now its update and work´s


1 Like