# 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
```bash
# 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
```
2. 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
```bash
# 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
```
3. Add partitions to /etc/fstab for automounting
```bash
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
```
4. Install Home Assistant dependencies
```bash
# 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
```
5. Install *os-agent*. You can find newest version of os-agent here: [https://github.com/home-assistant/os-agent/releases/latest]()
```bash
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
```
6. 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
```
[![](https://faq.urveboard.com/uploads/images/gallery/2023-03/scaled-1680-/fCCEzeUG9kQMkDzM-image-1679316390538.png)](https://faq.urveboard.com/uploads/images/gallery/2023-03/fCCEzeUG9kQMkDzM-image-1679316390538.png)
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.
```bash
docker ps -a
```
[![](https://faq.urveboard.com/uploads/images/gallery/2023-03/scaled-1680-/OxjEiSUyZFrFQUrA-image-1679316735991.png)](https://faq.urveboard.com/uploads/images/gallery/2023-03/OxjEiSUyZFrFQUrA-image-1679316735991.png)
8. After all these steps you can access Home Assistant page on default port 8123
[![](https://faq.urveboard.com/uploads/images/gallery/2023-03/scaled-1680-/dj92qEWqC0Bo7GOj-image-1679317177839.png)](https://faq.urveboard.com/uploads/images/gallery/2023-03/dj92qEWqC0Bo7GOj-image-1679317177839.png)