External database?

To the best of my understanding, the recorder: option only saves historical data of entities to an external database.

And all the actual data, configuration, etc, are written in the .storage directory.

Is there a way to configure Home Assistant to save all it’s data to an external database, like mariadb or postgres?

For example uptime-kuma asks for a database info during setup, and writes everything there.

Can I do this with HA?

Not all, no. Only the state and statistics data (recorder data) can be saved to a different database.

See: https://www.home-assistant.io/integrations/recorder/#custom-database-engines

Any idea if there are any plans to implement an external database feature? It seems strange to me tha such a huge project doesn’t support this. It’s almost 2026. Who writes to files?

Look at the influxdb and grafana add ons for external storage of metric and events and advanced dashboard trickery.

That said, .storage has the advantage of being quite solid.

It’s also not true that HA doesn’t use a database, see Database - Home Assistant

Home Assistant uses databases to store events and parameters for history and tracking

That’s it though. events and parameters for history. Whereas it could store device information, automations, scripts, scenes, tokens, and basically all the information. My point is, if an external database was used, .storage would not be needed.

You mentioned grafana, which I use to create dashboards, and this is it’s configuration. I don’t even have to mount a volume. Everything goes into mariadb. I can delete the container and re-create it, and I wouldn’t lose a single byte.

  grafana:
    image: grafana/grafana
    container_name: grafana
    hostname: grafana
    restart: unless-stopped
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Europe/Nicosia
      - GF_DATABASE_TYPE=mysql
      - GF_DATABASE_NAME=grafana
      - GF_DATABASE_USER=grafana
      - GF_DATABASE_PASSWORD=grafana
      - GF_DATABASE_HOST=mariadb:3306
      - GF_AUTH_ANONYMOUS_ENABLED=true
    ports:
      - 3000:3000
    depends_on:
      mariadb:
        condition: service_healthy

it kind of creates a mess on my repo. defeats the point of using containers.

and these are the containers that need a volume, all the others simply write to databases.

anyway, my 2c.