Using a Debian/Ubuntu installation on LXC or VM and install the APT packages, or manual installation
Using a Debian/Ubuntu installation on LXC or VM and install openHabian and openHab from there
I’m keen on openHabian since I’ve used for many years on a Raspberry Pi 3. But I know that is not officially supported out of Raspberry PI OS.
Having said that I would like to have some feedback from people that is running openHAB on Proxmox and on how have they made their installation. Pros , Cons, Pain-Points , things they did that they now would do in a different way. All the feedback is welcome.
My OH is in a docker container in a debian LXC. I was running in docker on a standalone box for a while first, so it was just easiest to keep docker when I switched over to proxmox. I’ve no complaints at all.
However, there is one significant consideration: hardware connections. For example, I do have a z-wave system and a z-wave usb stick. Passing usb through to an LXC can be a bit of a pain point, and if I had to have my z-wave stick still connected to OH for the z-wave binding, I probably would have gone with a different install (e.g., a VM which it is easy to pass the usb through to). In my case I can use the LXC for OH because I’m using the z-wave stick through zwave-js-ui. So, that is running on a debian VM (in a docker container) and then connecting to OH via mqtt.
I actually have a few different LXCs and VMs running docker engines which segregate my services into different functional groups (e.g., IoT, network, general, etc.). Each of those docker engines runs a portainer-agent container and then I can administer them all from a single portainer interface for all quick and easy actions.
Caveat: I’m on my first proxmox box and learning as I go, so all advice should be scaled in value accordingly.
It’s known to work just find on Debian so long as you use the same version of Debian that corresponds with the latest Raspberry Pi OS.
I currently run OH on Proxmox in an Ubuntu 24.04 VM in a Docker container. It works like a champ but were I to do it over again, I’d either create a custom LXC container or just spin up a Debian LXC container, install Docker and run OH in the container. IIRC, there is a way to passthrogh USB devices which is pretty much the only gotcha I can think of that might come up.
All that is to say that you probably can’t go wrong with any of these approaches.
The main reason I want to eventually move to LXC containesr over the VM approach is given the way the kernel uses RAM as a cache in Linux, You can see it if you run htop, a huge amount of RAM is used but available. But if a VM is using it, that means the other VMs can’t.
I think it would be more RAM effecient over all. There’s only one kernel using cache instead of N + 1 kernels using up RAM with their own cache (where N is the number of VMs).
Note that the machine I’m running on is maxed out at 32 GB RAM and I’m running a lot of services split between two VMs (zabbix, openHAB, wyze-bridge, mosquitto, manyfold, gitea, minecraft, photoprism, nextcloud, redis, postgresql, elasticsearch, and plex) and I’ve had to move a bunch of services to other machines because of lack of RAM (paperless, vaultwarden, waveplus-bridge, graylog, calibre, heimdall, atuin, searxng, semaphore, and guacamole).
Maybe I wont move to an LXC afterall. Or maybe move everything but OH to LXC. I still use my Zwave/Zigbee combo dongle.
I do the same which is why I have to VMs.
I too cannot claim to be a Proxmox expert but so far this has worked for me. I mainly just migrated from ESXi because they no longer support my hardware. This was before the whole Broadcom acquisition which probably would have made me move over even if they did still support my hardware.
I use a variation of the LXC container from the Proxmox helper scripts. I changed the JDK from Zulu to OpenJDK since this was the official recommendation of the openHAB project when I set this up.
So far it works like a charm and for the reasons Rich mentioned I would never go VM unless you don’t plan to add more services to run on your machine in the future. You just run out of resources (not just RAM but also CPU cores) too quickly on the usual small machines you run at home. Moreover even when you host a large variety of services you rarely use them simultaneously so there is usually no need to reserve resources permanently.
I don’t use proxmox for long but my experience with USB devices in LXC containers was very smooth and easy. But I think the possibility to do this from within the UI was just added in the latest version. I think it was a bit harder in earlier versions.
Before that I ran OH in docker on a bare metal Ubuntu install. I decided against docker in my current LXC setup but I run other services as docker containers in LXC without problems so I don’t see a reason not to do that except that I don’t really like to have to update both the LXC and the docker container.
@JustinG , @rlkoshak how to you backup your openHAB installation? Do you backup the LXC container/VM at Proxmox level or do you use any other tool inside the visualized Linux LXC/VM ?
I’m a little lazy with my OH backups. All of my config is source controlled through git on a separate VM any my gitea server gets backed up separately. So for OH all I really need is to back up the embedded databases. For that I have a cron job that runs nightly that just tgz’s up the folders I mount as volumes and save that off to the NAS, which will also include the configs.
Before doing a major OS upgrade I’ll take a snapshot of the VM.
I tried using the Proxmox backup mechanism but I counted figure out how to get it to not also try to back up mounted NFS volumes too except by shutting down the VM.
Once a month I’ll move a copy of the backups to an external drive. So for my OH config I have at least five copies on at least three different drives at any one time, though of different ages.
But my approach is very adhoc and bespoke. I can’t say I would recommend it as a best practice.
As I understand it, you’d only use the helper scripts to initially set up the container. After that you’d update it same as you would in a VM or battery metal. You’d ssh to the lxc container and atp upgrade or follow the manual upgrade steps for manually installed OH instances.
LXC containers are not quite so ephemeral as Docker containers are intended to be. At heart as I understand then
I use the proxmox backup systems. Nightly backups go to a drive on the proxmox box itself, keeping the three most recent. Weekly backups are stored on my synology and every couple of weeks the synology is backed up to my encrypted iDrive. If I’m making significant changes to some OH configuration, I also check those out to a git repo before and usually after.
Before I moved to proxmox, I used borg for most of my backup and I’m honestly considering setting that back up again. The proxmox backups are convenient and easy, but they full backups and not sequential so they take up a little more space than I’d like. This is really only an issue because of the occasional online backup to iDrive and how long it can take. I’ll probably get back to working to optimize this a little more in the future, but I’ve got enough other projects at the moment that it’s not a huge priority.
I have 2 proxmox backup servers and I pull the data from one to the other once a week.
That was the table above I posted.
It does garbage collection and verify as well.
Yes I guess they are always full because the backups should be deduplicated on file system level when using ZFS. I intend to setup a backup server but was starting by running backups just locally until I migrated all services from my old server to make this the new backup server. In order to see how well the backup system works I started off with a rather extended retention policy but haven’t run into problems so far even when keeping almost 30 snapshots per container. I’m really happy with it so far
I’m still missing windows client support by the backup server though, which is what still holds me back to setup the proxmox backup server. I’m using UrBackup until now but it does not make a lot of sense to move this to my proxmox server so I’d rather have one solution for all system I want to backup.
One other area of consideration with containers (at least for me), was the networking component. I use the network presence add-on, and so I believe that required a specific network config. I believe there is one other add-on that I use that required a network bind.