Correct way to mount configuration.yaml and .storage in docker

As per the installation instructions, I installed HA core on a Raspberry Pi, like this:

  home-assistant:
    image: homeassistant/home-assistant
    container_name: home-assistant
    hostname: home-assistant
    restart: unless-stopped
    network_mode: host
    cap_add:
      - NET_RAW
      - NET_ADMIN
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Europe/Nicosia
    volumes:
      - /run/dbus:/run/dbus:ro
      - ./config/home-assistant:/config

And I placed a default configuration.yaml in ./config/home-assistant/

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

I started the container, and in the logs it complained that it’s missing automations.yaml, scripts.yaml and scenes.yaml.

Which makes sense because they don’t exist in ./config/home-assistant/. But shouldn’t it create them?

Then I started adding devices in Home Assistant. Aren’t those saved in /config/.storage? Where is that directory? Shouldn’t it be in ./config/home-assistant/ ?

Just trying to figure out how to keep the important files outside docker, mounted as volumes. In theory everything should be in ./config/home-assistant/, but they are not.

Not 100% sure as I don’t use docker for HA. But the folder for configuration.yaml will be ./config/home-assistant/config also HA will create the file during install.

Please correct me if I am wrong :slight_smile:

It will be in ./config/home-assistant/.storage
It’s “hidden” (starts with a dot) so make sure to take that into account

Generally first run you make folder and it creates config

If it didn’t create them just make empty file and set proper permissions

In docker config folder is /config
Then you have /config/.storage

You’ve done a mix of things.

Either clear out your config directory, start HA, and it will create the minimum config, after which you can start to tweak things, or create the missing files, because you’ve started with your own configuration.yaml.

Everything sits under a single config directory (except your DB if you host it with anything but SQLite).