# Setup & Configuration

We need to install the service through Portainer and configure any necessary settings.

# Preparation

There are some things we need to do in preparation to install this service.

## Volumes

<details id="bkmrk-media-folders-radarr"><summary>Persistent Data</summary>

This is where the service will store its own application data and ensures we can quickly update the service image.

<p class="callout warning">Ensure your user has permissions to access the folder.</p>

</details><details id="bkmrk-dbus-socket-this-ser"><summary>Dbus Socket</summary>

This service needs access to the Linux Dbus, or [Desktop Bus](https://en.wikipedia.org/wiki/D-Bus#:~:text=D%2DBus%20(short%20for%20%22,such%20as%20GNOME%20and%20KDE.), in order to access Bluetooth, audio and other hardware devices. We will only be providing "read-only" access meaning it cannot make changes.

<p class="callout warning">This is required and the service will fail to start without access.</p>

</details>## Environment

<details id="bkmrk-tz-this-is-the-curre"><summary>TZ</summary>

This is the current time zone formatted using the [tz database.](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)

<p class="callout info">*For example:* America/Vancouver</p>

</details>

# Installation

The service can be installed through the Portainer web interface.

<p class="callout info">Learn about [creating a new stack](https://hub.subspace.services/books/portainer/page/creating-a-new-stack "Creating a New Stack").</p>

## Docker Compose

Use the following code to install the service:

```yaml
---
services:
  home-assistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      # Persistent Data
      - /srv/home-assistant/:/config

      # Hardware Access
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    environment:
      - TZ=America/Vancouver
    privileged: true
    network_mode: host
```

# Updating

<p class="callout warning">Backup and Re-Deploy the Stack</p>

Home Assistant has been optimized for running in Docker. This allows you to [re-deploy the stack through Portainer](https://hub.subspace.services/books/portainer/page/updating-a-stack "Updating a Stack") to download the latest updates.

Integrations within your Home Assistant, especially those from the [community store](https://www.hacs.xyz/), may encounter issues with newer updates. It is always a good idea to have a backup to downgrade your installation in case of errors.