One of the biggest files in a Home Assistant config folder is usually home-assistant_v2.db. That’s the recorder: every state change and event gets written there so you have history graphs. I run Home Assistant on my Unraid server, and the recorder settings are the part I’d look at first when appdata starts to grow.
Out of the box the recorder keeps 10 days of history, purges older data every night at 04:12 and repacks the database on the second Sunday of the month. Two settings in configuration.yaml make the biggest difference: purge_keep_days for how far back history goes, and exclude for the entities that change constantly but that you’ll never look at in a graph.
recorder:
purge_keep_days: 7
exclude:
domains:
- update
entity_globs:
- sensor.weather_*
entities:
- sensor.date
- sun.sun
Restart Home Assistant afterwards. With the linuxserver image on Unraid, /config usually maps to something like /mnt/user/appdata/homeassistant, so that’s where you watch the file size.
My advice is to start with the exclude list. A power sensor that reports every few seconds or an uptime sensor fills far more rows than a door contact, and cutting a handful of chatty entities often does more than shaving days off the retention.
A few things to know before you do it. Excluded entities get no history at all, so their graphs on dashboard cards stay empty. A purge doesn’t shrink the file right away either: the space comes back when the database is repacked, which by default happens monthly. And keep free disk space at least as big as the database, because a repack or a table rebuild during an upgrade can copy the whole thing.
Further reading: Recorder integration (Home Assistant)
Going deeper: Guide: Home Assistant backups in Docker, with a failure alert on your phone and a copy off the box