Docs
/
Installation
/

Backing Up Docker Volumes

Backing Up Docker Volumes

When You'd Use This

ScenarioWhy direct volume access
Koios won't start or is otherwise unreachableThe in-app UI is unavailable, so the only way to capture state is directly from the volumes
Migrating to a new hostLets you move the raw volumes between machines without going through the app
Host-level disaster-recovery scriptsVolumes can be snapshotted from the host on the same schedule as the rest of your infrastructure

If none of these apply, stop here and use the in-app backup instead.

Docker Volumes

All Koios data lives in seven Docker volumes:

VolumeContentsPriority
koios_data_postgresConfiguration database (devices, tags, users, models)Critical
koios_data_influxdbTime-series database (historical tag values)Critical
koios_secretsAuto-generated credentials (database passwords, Django secret key, time-series database token)Critical
koios_mediaUploaded files (ML models, component packages)High
koios_licenseLicense activation fileHigh
koios_certsSSL certificatesMedium
koios_logsApplication log filesLow

The three Critical volumes are enough to rebuild a working install. The others carry uploads and configuration that are convenient to keep but recoverable from elsewhere.

Backup

Back up a volume by running a temporary Alpine container that mounts the volume and creates a tar archive in the current directory:

docker run --rm \
  -v koios_data_postgres:/data \
  -v $(pwd):/backup \
  alpine tar czf /backup/koios_data_postgres.tar.gz -C /data .

Run the same command for each volume you want to back up, swapping the volume name and archive filename. At minimum, back up the three Critical volumes (koios_data_postgres, koios_data_influxdb, koios_secrets). Add koios_media and koios_license if you have uploaded models or an activated license.

Restore

Stop Koios, then restore each archive back into its volume. This command deletes the volume's contents before extracting, so the restore is a clean replacement:

docker run --rm \
  -v koios_data_postgres:/data \
  -v $(pwd):/backup \
  alpine sh -c "rm -rf /data/* && tar xzf /backup/koios_data_postgres.tar.gz -C /data"

Repeat for every volume you need to restore, then start Koios again.