How to install openHAB on Proxmox?

  • Platform information:
    • Hardware: intel N100 mini PC, 16GB RAM, 256GB NMVe SSD
    • OS: Proxmox VE 8.2.7
    • openHAB version: stable 4.2.2

I’m about to install openHAB on Proxmox and I’m not sure what would be the best approach. I’m aware of the following installation procedures:

  • Proxmox VE Helper-Scripts that uses an LXC container
  • Using Docker and openHAB Docker image
  • 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.

Thank you
Eurico

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.

just my 5 cents
Use VM if you need live migration.

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 do this:

As well as use the proxmox backup program which does the proxmox VM to another computer.

1 Like

@DrRSatzteil have you had to upgrade you openHAB installation ? if yes how did you do it since the Helper Scripts only create a fresh installation ?

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

you need volume for backups and you can use integrated backup directly. No need for external backup server.

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.

Yes I did. You can just use the package manager (apt) as usual to update the installation.

The first backup on proxmox is full and the others are incremental and the data is deduplicated on the server to conserve space.
I run it once a week.

Details

VMID Name Status Time Size Filename
100 jed164-old ok 24min 32s 250 GiB vm/100/2024-10-19T14:00:02Z
101 webserver ok 1min 15s 20 GiB vm/101/2024-10-19T14:24:34Z
103 webserver-old ok 3min 59s 30 GiB vm/103/2024-10-19T14:25:50Z
104 pfsense ok 10min 34s 32 GiB vm/104/2024-10-19T14:29:49Z
105 win10 ok 7min 42s 59.57 GiB vm/105/2024-10-19T14:40:23Z
106 zoneminder ok 9min 17s 13.313 GiB ct/106/2024-10-19T14:48:06Z
107 emby ok 21min 39s 132.202 GiB ct/107/2024-10-19T14:57:24Z
108 moonbi164 ok 16min 44s 125 GiB vm/108/2024-10-19T15:19:03Z
1000 debian12-initcloud ok 8s 2 GiB vm/1000/2024-10-19T15:35:47Z

Total running time: 1h 35min 53s
Total size: 664.086 GiB

Guess I haven’t found that setting yet, because it is definitely not the case for my backups…I’ll look around.

Are you using proxmox only, or are you also using the proxmox backup server?

I just use the backup server.

Yeah, I haven’t looked into the backup server yet. Without it, the basic proxmox scheduled backups are always full.

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 :slight_smile:

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.