# Install Home Assistant Supervised On Arch Linux

Installing [home-assistant](https://bit.ly/3klPCTG) did not turn up to be what I expected. It does not support [add-ons](https://www.home-assistant.io/addons)! I learned it the hard way when I was setting up [ESPHome](https://esphome.io/guides/getting_started_hassio.html). Here goes my journey of installing Home Assistant **Supervised**.

# Background

This is a story of the mistake I made, and some HASS knowledge I learned. You can skip this part and `goto` *[Installing Dependencies](#installing-dependencies)*

There are 4 types of installation method: OS, Container, Core, Supervised. This is a nice [chart](https://bit.ly/3tPhOl2) comparing differences in capability. Arch's `home-assistant` installs Core, and does not support add-ons. During the first few months of usage there were no issue as most of my devices can be integrated with HASS out-of-the-box. Recently I am building a custom sensor and realised that ESPHome add-on cannot be installed 😢. That is how I ended up reinstalling HASS and writing this article.

*Good explanation of different installation methods on YouTube: [Home Assistant Installation Methods EXPLAINED!](https://youtu.be/HF6fd5Oi1N8)*

# Installing Dependencies

This installation method is not officially supported on Arch Linux. HASS seems to have preference for Debian only 😡. Read this before you get started: https://bit.ly/3AuOnY8, hopefully you know what you are doing.

## Docker

Install and enable Docker service.

```bash
sudo pacman -S docker
sudo systemctl enable docker
```

Setting [`journald`](https://docs.docker.com/config/containers/logging/journald/) as default logging driver. Edit */etc/docker/daemon.json* (create this file if it does not exist)

```json
{
  "log-driver": "journald"
}
```

Start Docker service.

```bash
sudo systemctl start docker

# Test that docker is working, and check logging driver.
sudo docker info
```

## NetworkManager

Previously I was using [`systemd-networkd`](https://bit.ly/3nN4IUs) to manage network configurations. I have to disable it and setup NetworkManager instead. Avoid running both `system-networkd` and NetworkManager, as it might result in conflict.

Refer to this ArchWiki for installation guide: https://bit.ly/3lAxUeF

## AppArmor

ArchWiki reference: https://bit.ly/3knRVFM. I have no plan to use AppArmor yet, so I did not configure kernal to load it, neither did I enable `apparmor.service`. HASS seems to work for me so far.

```bash
sudo pacman -S apparmor
```

## jq

A command-line JSON processor.

```bash
sudo pacman -S jq
```

# Install HASS

```bash
curl -Lo installer.sh https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh
sudo bash installer.sh
```

When asked "Do you want to proceed with overwriting the /etc/network/interfaces file?", I choose "N". It seems to be a file used in Debain derivatives.

![Screenshot 2021-09-19 at 16.28.48.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1632042323584/0dk6Byp9i.png)

❗ Now restart. For some reason Docker is unable to create network bridge, and it is resolved by restarting Linux. An Arch user reported that this happens whenever kernel is updated and can be resolved by restarting Linux. Reference: https://serverfault.com/a/831489/216503

# Onboarding

If you can load http://[host-ip]:8123 in your browser, it shows that you have successfully installed HASS 🎊. Now you can proceed with [onboarding](https://bit.ly/3kl4ba0) process. 
