Here are some instructions I used with students I work with to install HA on a RPI image on dockers. This was this year so I believe the instructions should still be good.
Make sure Debian is using legacy iptables as required by dockers
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
Make sure system packages are up to date and install Home Assistant required packages
sudo apt-get update; sudo apt-get -y upgrade
Install needed packages
sudo apt -y install jq libglib2.0-bin udisks2 network-manager network-manager-config-connectivity-debian netcat mosquitto-clients networkd-dispatcher ifmetric systemd-journal-remote
Install docker – first grab a key for docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add key to repo keyring and add the docker repository so you can pull docker package
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]\
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Make sure the list of available packages is updated then pull and install the appropriate docker packages
sudo apt-get update;sudo apt-get -y install docker-ce docker-ce-cli containerd.io
Pull the agent application required by home assistant
wget -cq --show-progress https://github.com/home-assistant/os-agent/releases/download/1.4.1/os-agent_1.4.1_linux_aarch64.deb
Install the agent
sudo dpkg -i os-agent_1.4.1_linux_aarch64.deb
Enable the dns service required by HA
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
Set up a fake grub bootloader file so HA install package works
sudo touch /etc/default/grub
echo '#!/bin/bash' | sudo tee /usr/bin/update-grub
echo 'echo got it' | sudo tee -a /usr/bin/update-grub
sudo chmod 755 /usr/bin/update-grub
Add some kernel arguments, some that are required by HA, some that make the system more stable.
sudo sed -i '/rootwait/ s/$/ systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false usbcore.autosuspend=-1 usbcore.autosuspend=-1 clk_ignore_unused cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory apparmor=1 security=apparmor/' /boot/broadcom/cmdline.txt
At this point it would be a good idea to reboot and then connect back to your pi via putty using:
sudo shutdown -r now
Install HA containers via the following:
wget -cq --show-progress https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
sudo dpkg -i homeassistant-supervised.deb
A menu will pop up and you need to select the correct board type (raspberrypi3-64). This will indicate a reboot is required, but that’s not the case as we rebooted above.
At this point it’ll take a while for all the home assistant docker containers to download and be installed. In your pi command window you can do:
watch sudo netstat -lntp
Once you see services listening on ports 4357, 8123 and 40000 your system should be up and running. This will take a while, like 12 minutes or more, as the system is downloading all the docker containers required for home assistant. Once you see port 8123 is up and running you can actually connect with a web browser. The web page presented will refresh once everything is up and running and you can finish the initial configuration via the web install.