Installing Home Assistant Supervised using Debian 12

Can you explain how make this?

Tks!!

Could you please clarify what you mean by ā€œhow to do it?ā€ What problem are you talking about? If the problem is with curl: (6) Could not resolve host, then try rebooting Debian 12, sometimes that helps, if that doesnā€™t help, then try doing this post, it worked for me, and if that doesnā€™t help, then you can do the following

If there is no privileged access

Create a user

sudo useradd -rm homeassistant

Add a user to the docker group

sudo usermod -aG docker homeassistant

Open the daemon.json file

nano /etc/docker/daemon.json

and add the line ā€œgroupā€: ā€œdockerā€.

{
ā€œlog-driverā€: ā€œjournaldā€,
ā€œstorage-driverā€: ā€œoverlay2ā€,
ā€œgroupā€: ā€œdockerā€,
ā€œip6tablesā€: true,
ā€œexperimentalā€: true,
ā€œlog-optsā€: {
ā€œtagā€: ā€œ{{.Name}}ā€
}
}

Rebooting docker

sudo systemctl restart docker

Background information

Create a user and home directory

sudo useradd -rm homeassistant

Add a user to the docker group

sudo usermod -aG docker homeassistant

Remove a user from the docker group

sudo gpasswd -d homeassistant docker

Display the list of users, where you can see which group the user is in

cat /etc/group

Get homeassistant user ID

id homeassistant

Delete user homeassistant

sudo deluser homeassistant

1 Like

A simpler and cleaner way to resolve this issue you will find HERE.


I strongly advise you to not do the following:

The above ā€œsolutionā€ by simply adding another user (homeassistant here) and assigning certain privileges to that user is a workaround at best.

If you really follow:

Section 1 - Install Debian 12, pharagraph 1.11)

and

Section 1 - Install Debian 12, pharagraph 1.16, Step 1.10),
and
Donā€™t miss this one (!): Pharagraph 1.17)

There will be no need to add that additional user ā€œhomeassistantā€. Neither you will need to tamper with the permissions of the docker container.

Keep it nice and simple!

Probably caused by half baked knowledge about the security/privileges concept of *nix systems some users are just skipping Section 1, pharagraph 1.17 and simply continue the guide as the root-user without being aware of the consequences this might bring up!

1 Like

and @GSzabados I use openssh server on the host as per normal, port 22 as usual.

I also use the advanced ssh & web terminal addon in HA, set to port 2222.

Both work fine and I have never been seen as unhealthy. (not on account of ssh anyway).

It may not be strictly according to Hoyle, but it works.

1 Like

cgroup errors are resolved by installing homeassistant-supervised.deb. The post install script takes care of it. Perhaps you didnā€™t follow the instructions.

Absolutely correct :+1:t3:

Most obviously!


And if you read (I mean really read, not just skimming through) the referring pharagraph you will notice that little:

before the execution of:

where this is done by being a ā€œnormalā€ (unprivileged) user and only temporarily root privileges are granted to the user/group to access system resources for executing those individual commands by prepending ā€œsudo -iā€.

If you are not familiar with the sudo command in Linux I recommend you to read through ā€œLinux sudo commands for beginnersā€ to get the idea why it is important to do adminitrative tasks as a non-privileged user whenever possible.

2 Likes

Chefs kiss for those setup scripts, just moved to Debian and the install and restore from another HA instance went flawlessly. Nice work.

2 Likes

I donā€™t know if I did everything correctly but after the installation HA seems to run as root. How do I change it to run as non-privileged user?

You donā€™t - it runs as root by design.

That sad. The HA keeps reminding me how not safe it is. It even blocked updating itself for a while.

Thatā€™s got nothing to do with HA running as root.

1 Like

Iā€™m following the guide exactly, but after installing the packages, during docker installation I get:

curl -fsSL get.docker.com | sh
curl: (6) Could not resolve host: get.docker.com

I tried several hacks in this thread, but they didnā€™t work except for this one.

For those who will be looking for this, hereā€™s a working solution: #1076 by SkynetNexus

I had this happen on an install today. The install script sent a lot of DNS queries at once and triggered anti flood protection on the router (depending on your router settings). It filtered the client connection and stopped all DNS requests and hence " Could not resolve host: get.docker.com" error.

Simple fix was to reboot which clears the cache and it works again. Also making sure ipv6 is disabled. Something to look into if you have that issue as it worked for me.

Hello !

Clean install Debian 12 (last release) and folowing instruction I get the following errors:

  1. dns stops working after completion of execution ā€œapt install apparmor jq wget curl udisks2 libglib2.0-bin network-manager dbus lsb-release systemd-journal-remote systemd-resolved -yā€

  2. errors when executing the installation script HA

  3. after correcting errors with hands, I try to restore a backup copy and it turns for hours (while the machine does not use computing resources)

For a possible solution to the dns-issue you might want to look HERE.

You should have given more attention to ā€œSection 1 ā€“ Install Debian 12ā€, step 1.10, step 1.16, and step 1.17.

With this you would have continued ā€œSection 2 - Install OS Agent, Docker and Dependenciesā€ as that non-privileged user you have created with step 1.10 which in turn would most probably have saved you from these kind of privilege issues like ā€œcouldnā€™t be accesses by user '_aptā€ā€™ and ā€œ(13: Permission denied)ā€.

1 Like

Someone please help me, when I execute this command I get an error. I donā€™t know how to fix it.

The problem shows loud and clear into the eyes:

Maybe you want to re-read and understand the very beginning of the guide?

Armbian is not Debian but a derivative and as such it is not supported by Home Assistant Supervised and neither by this guide!

3 Likes

My two cents for those who get Could not resolve host: error.

Open /etc/sysctl.conf

sudo vim /etc/sysctl.conf

Add these lines to the end of file:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.tun0.disable_ipv6 = 1

Save and exit vim

Esc + :wq!

Reboot

sudo reboot

After reboot I was able to resolve hosts.

Edited: added sudo as nickrout suggested.
Love vim <3

nano is somewhat easier than vim :smile: Also worth noting you will have to be root user or use sudo.

4 Likes

I am in the same position:

  • Hardware is RasperryPi4 + official 7" touchscreen. Tested & working with Rasperry Pi OS.
  • Installed Debian 12.
    • Note: I added ssh keys just after flashing, before installing, to give me ssh access.
  • Installed Home Assistant. It works if IO connect remotely.

But the touchscreen is just grey. During boot, text scrolls by, then there is a short colourful display, then it all goes gray. I am currently blocked on this.

Iā€™d like to install X and get the HA dashboard on the screen.

I expect there will be some driver configuration issue, then I should at least get a terminal window on screen. After that the rest should be relatively straightforward.