HA - Docker Backup (where are my devices, etc)

You should be mapping a volume with your docker run command to a persistent data folder on the host/pi for the config. Otherwise, every time you rebuild the container (which will be required when an new home assistant update comes out) your config files will not persist and will be deleted with each new container build.

Here’s how volumes and persisting data works with docker:

Docker containers by their nature are meant to be “Ethereal”, and volumes should be used to persist data, NOT finding the data within the container itself.

You should define a volume per the install documentation

Your run command should look like this instead

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=America/New_York \
  -v /home/pi/homeassistant/config:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

Once you do that all the config data will be located in your /home/pi/homeassistant/config directory.

From there, just backup that directory. I wrote this up about using rsync to do a backup of the config volume for home assistant container

1 Like