Openhab 3 Docker vs raspberry

Hi everyone, since openhab 3 is around the corner I’m thinking how i will continue. Today I have openhab 2 install in a server with another programs, I’m moving my diferent servert to docker so I love the idea to move openhab to docker, but that means to put all the eggs in the same basket, also I’m still new with docker and i want to use exec and ssh in docker. My other option is to move openhab to a rapsberry 3. But the fisrt time I did that i have problem with the sd card and stability.
Finally I have usb zigbee/zwave dongle. So if I choose rapsbetty, the usb will be connect directly in the middle of the house. If not i will use the raspberry all the same for ser2met to socat conection (I still can’t get it to work properly).
The most important thing is stability and availability. So I ask Docker and raspberry user your opinions.
Thanks

If you are already running on a server I see little benefit on moving to a Pi. I moved from a Pi quite a while ago and not use it for OH testing.

My current plan is to install docker on my server & put OH3 in that along with HABApp. My current OH2 is running natively in the VM.

Your requirements will be unique so it’s hard to give any meaningful advice. I personally run four VMs on a single machine using ESXi. I deploy all my services, including openHAB as containers to the VMs (each VM has a separate purpose, one of which is where all the home automation services are deployed) using Ansible. I run a little service (https://github.com/rkoshak/sensorReporter) on RPis around the house to interact with relays and sensors and such. That script also supports running command line scripts so that’s how I manage Exec binding stuff. I don’t do any ssh stuff from openHAB itself.

1 Like

I use docker on my home server. I have about 10-15 containers running different services.
I’m a huge fan of Docker, I use it a lot professionally in AWS-environments as well as onprem servers and development environments.

However a few things I prefer to run bare metal (that is a dedicated machine/unit) and that is firewalling/routing and OpenHAB. Running OpenHab bare metal will remove some complexity as well as give you more performance. RPIs are so cheap I would suggest you run OpenHabian on one of them. Don’t worry about sdcard wear out, there is Zram, and if you get a decent quality sd card that is large, you won’t have that problem. The built in backup feature in Openhab is also great, so doing backup of entire containers is not really necessary.

You need to copy it off-server though.

If you use Docker Volumes properly you do not need to back up the OH Docker container. All the data is external. Mine is all in one directory tree,

You still need to copy the backup files somewhere. Like to a different server, another volume or a cloud storage. Personally I commit everything in a version control system. The version control system is then rsynced into 4 different drives and finally encrypted and put into amazon s3 glacier deep storage. If your computer blows up, you need that off site backup.as well. Taking backup is a science and there are no super simple solution.

1 Like

When you systematically take on this question with a focus on reliability, your first insight should be the need to have spare hardware for everything including the server metal. That’s where I myself always end up with a RPi (a set of 2 or 3, that is) for obvious cost reasons.
Second insight is my preference for a dedicated server for home automation. Just like yourself I dislike to put all of my eggs into a common basket just to stumble carrying that.
Hypervisors and even more so Docker always means at least some dependency on shared hardware (think RAM, CPU and I/O load) and a shared virtualization layer. It’s anyone’s choice to rate that high or not (so to call that an ‘insight’ would have been a little too strong and maybe unfair), but with a cheap RPi you eradicate any such risk by design simply by going dedicated bare metal in the first place.
That being said, there’s very little benefit in going Docker on that single box if all you run is openHAB exclusively anyway. That only increases complexity and consumes scarce ressources (specifically RAM) - that’s how I end up with a bare metal openHABian RPi every time I re-evaluate this question for myself.

PS: and with the NGRE in OH3 the suffering on load/startup times will hopefully finally come to an end

Which one do you refer to ? Amanda ? “auto backup” SD mirroring ? or just openhab-cli backup ?
Just in case you wouldn’t know, Amanda can also directly backup into S3.

1 Like

My biggest problem is that I live in Argentina and hardware is expensive and scarce. bridge, repeaters, sensor, everything (even sonoff) is expensive and scarce. So i must considere how to take advantage of everything that i have (I know you can’t solve this). I belive first iI willl try to resolve with a raspberry pi, and see what happend. I will investigate zram and other ways to reduce sd problems.
Thanks

1 Like

Amanda and openhabcli, can’t comment on SD-mirroring. Auto backup is nice a feature as well, although I’m not using it since I mange backups by version control. I have a cron job that runs and detects local changes, if there are local changes it will auto commit them and notify me, but usually I don’t do local changes on the rpi instance itself. I run another script via ssh which performs a pull of latest code on the rpi, if I have change some rules or similar.