Home Assistant

Installation steps on SD Card

Currently it is possible to install home assistant on sd card due to the size of home assistant. Boot version should be from 2023.02.22. You can check boot date with command uname -v.

  1. Format SD Card and create new partition
# format SD card (mmcblk1)
sudo su
sgdisk --zap-all /dev/mmcblk1
parted -s /dev/mmcblk1 mklabel gpt
parted -a opt -s /dev/mmcblk1 mkpart primary ext4 0% 100%
mkfs.ext4 -F /dev/mmcblk1
  1. Mount created partition to /mnt/sd. Also create link between /mnt/sd and /var/lib/docker. In this case every docker container will be on sd card
# mount SD card to docker folder
mkdir -p /mnt/sd
mount /dev/mmcblk1 /mnt/sd
mkdir -p /mnt/sd/docker
mkdir -p /var/lib/docker
mount --bind /mnt/sd/docker /var/lib/docker
  1. Add partitions to /etc/fstab for automounting
echo "/dev/mmcblk1 /mnt/sd ext4 defaults 0 0" | sudo tee -a /etc/fstab
echo "/mnt/sd/docker /var/lib/docker none defaults,bind 0 0" | sudo tee -a /etc/fstab
  1. Install Home Assistant dependencies
# Install requirements
apt install apparmor jq wget curl udisks2 libglib2.0-bin network-manager dbus lsb-release systemd-journal-remote -y
curl -fsSL get.docker.com | sh
sync
  1. Install os-agent. You can find newest version of os-agent here: https://github.com/home-assistant/os-agent/releases/latest
sudo wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_aarch64.deb
sudo chmod 777 os-agent_1.5.1_linux_aarch64.deb
sudo apt install ./os-agent_1.5.1_linux_aarch64.deb -y
sudo rm -f ./os-agent_1.5.1_linux_aarch64.deb
  1. Install home assistant supervisor. After first installation it will show error made by ipv6 support enabled. When asked about version select qemuarm-64
# Install home assistant supervisor
sudo wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
sudo chmod 777 homeassistant-supervised.deb
sudo apt install ./homeassistant-supervised.deb -y
echo "{\"log-driver\": \"journald\",\"storage-driver\": \"overlay2\",\"ip6tables\": false,\"experimental\": true,\"log-opts\": {\"tag\": \"{{.Name}}\" }}" > /etc/docker/daemon.json
sudo systemctl start docker.socket
sudo systemctl start docker.service
sudo apt install ./homeassistant-supervised.deb -y
sync

7. Check if installation is completed with command mentioned below. Home Assistant creates 7 containers. Depending on your internet connection you have to wait at least few minutes.

docker ps -a

8. After all these steps you can access Home Assistant page on default port 8123


Revision #7
Created 20 March 2023 12:07:26 by Adrian Porada
Updated 12 April 2023 11:11:50 by Piotr Pietryka