ZWaveJS2MQTT Docker Install Removes Container After Every System Restart

Hello All,

I’m taking baby steps with my Home Assistant installation, stopping and reading up on the processes at every step. I’ve installed HA in a Docker Container on my Manjaro Linux machine. I’ve started small, integrating ecobee, WiZ, and lots of weather integrations. I’ve been extremely pleased, so thought it was time to start migrating my Z-Wave and eventually my Zigbee devices. I decided to tackle Z-Wave first and it’s been more of a challenge than I expected.

I used the official guides for installation in a container, using the ZWaveJS2MQTT setup in a Docker. I have successfully setup this Container, linked it to my Zooz 700 series Z Stick, and joined 1 additional Node (Aeotec open/close sensor). It’s linked to HA through the ZWaveJS integration and everything looks good, until I restart the PC.

After restarting the PC, which I do frequently for updates, etc., I lose this container. In order to get it going again, I have to run the docker container install again.

`docker run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest`

This works to get it going again, but then takes a long time to update the 1 Node I have installed. After I add in multiple devices, this will become painful.

I’m looking for a recommendation to whether I should be doing this ZWavejs2MQTT install differently? I wanted to keep this installation down the “official” path as much as possible, so maybe I’m just missing something?

Thanks in advance to any recommendations anyone can provide.

First off, I would suggest going through some Docker tutorials and documentation to really understand what you’re doing.

The command you are using deletes the container when it is stopped, and runs in the foreground. So whenever you restart the system, it’s causing the container to be deleted. Neither of those options are what you want for a permanent long running process. The examples you copied are just that, examples to get up and running quickly, not meant to be used “in production”.

--interactive , -i 		Keep STDIN open even if not attached
--rm 		Automatically remove the container when it exits
--tty , -t 		Allocate a pseudo-TTY

Don’t use --rm -it, those are meant for single use containers. You would want to use -d to detach and run it in the background. Or better yet, use Docker Compose, which does all this for you and makes it easy to re-create the container for upgrades.

I agree but the copied from their docs. Here is what I am currently using. I put my config in /opt/zwavejs2mqtt.

docker run -d --restart=unless-stopped --name zwavejs2mqtt --privileged --network=host -v /opt/zwavejs2mqtt:/usr/src/app/store zwavejs/zwavejs2mqtt:latest

Yeah, that seemed strange to me to be part of the official docs. I am fairly new to Docker, only using it for a few containers.
The only thing I could think of was that it needed this due to the nightly update check/install. And maybe I’ve misunderstood that process, too.
Glad to know what’s in the docs are an example, as strange as that seems. It would explain my frustration.

Thanks for this! I will look at and alter my approach when I get a chance.

1 Like

You can put your config wherever you wish. That was just my personal choice.
I think your config is in a folder named zwavejs2mqtt in the folder from where you ran the docker command.

1 Like