Several HA installations running on same machine

Hello,
I am not falimiliar with docker, so I need to aks this that could be quite elementary for you.
Is it possible to install several HA instances on the same machine sharing resources?
I mean to install (for example 3) 3 dockers with 3 running HA installations but sharing same DB engine and other services? (similar to a multitenant environment)
If that could be possible… What happen with updates? Is it possible to update just HA without touching the other services?

Thanks in advance for sharing your thoughts.

Not familiar with multitenancy but in practice yes to all. Add three containers using different ports, three databases in e.g. mariadb (one container), just update the containers you want to update.

My question is why?

Hi @Mattias_Persson
Thanks for your answer.
The reason is because I want to run HA in a building that has 3 apartments, with 3 different families living each. And I have only one machine to be shared. So I need to run 3 independant instances of HA but since HW is limited (and I cannot upgrade it) I need to share the most services as possible between the 3 HA instances.
Can this be done? I wonder How?
If 2GB RAM, 32GB Storage, and 2vCPU are required to run a single instance, how much more could it takes for running 3?

Adding to Mattias’ feedback
I have a setup with two additional instance for ‘dev’ and ‘upgrade’ which allow me to test and restart without affecting the ‘main’ one.
Clashes I have had with shared hardware like rfxcom and in certain cases just way too much network traffic with odd connection drops. Then, you may also not want notifications form each one of them…but this depends on the (as Mattias stated) ‘why’ ?

Yes. I run 5 HA docker containers (and a bunch of other containers) on the same host.
I found that it works perfectly by just changing the port number in configuration.yaml:

homeassistant:
  internal_url: "http://10.0.0.11:12123/"
http:
  server_port: 12123

I am running this on a NUC8i7BEH with 32GB RAM. My HA containers use between 100-300 MB most of the time.

Edit: Why?
It was just a super easy way to separate various integrations or groups of integrations away from my main HA. Integrations that I for some reason do not want to restart too often. Either use online APIs or takes a bit of time to initialise on startup. And because there are too many entities that I do need (or want), but not necessarily in the main HA. It also makes it possible to have multiple retention times in the databases. So I will have only 0-2 days of data in some of the secondary containers.

2 Likes

Hi @vingerha
Thanks for your answer.
As I have replied to Mattias, it’s because I need to install HA on 3 apartments, with 3 different families living each and I have only one machine to be shared. So I need to run 3 independant instances of HA, but since HW is limited (and I cannot upgrade it) I need to share the most services as possible between the 3 HA instances.
Can this be done? I wonder How?
If 2GB RAM, 32GB Storage, and 2vCPU are required to run a single instance, how much more could it takes for running 3?

My 3 instances run fine wrt to capacity, I have a 7y old Intel NUC and CPU on average well below 20%.
On the comment of ports above…my main is on ‘net=host’ so it integrates without too much issues with other parts in my network, meaning that my dev/upgrade are (slightly) limited.
Now, I am wondering why you would not combine the 3 households in 1 HA env. and split the results to each afterwards?

Because I don’t want a person living in one apartment being able to control devices of other apartment. I mean to prevent a neighbor turn on the light of the next door apartment or watch an indoor camera, for example.
And as far as I understand it’s not currently possible to grant or restrict that kind of access at user level. Am I right?

I am not 100% sure of all the details around access … but as a suggestion, you could present a dashboard with a page(s) per apartment, only accessible by that user(s)…then they would not have access to other app. stuff.

Sounds good but as far as I know it’s not possible to grant/prevent a user to access and see only certain pages. I may be wrong, and I will investigate further, but I think that If you create users they can access and see everything.

This instance only has admin but… here you can add/remove the other users

1 Like

It seems I was wrong. Thanks for letting me know this.
Nevertheless I still prefer the multi instance approach that seems to be more secure (private) with everything is isolated.

Possibly but it also means more maintenance, more hw-resource, etc…both options have their pro/con :slight_smile: