Skip to content

Databases and backups ​

Layout ​

  • Each app gets its own Postgres (postgres:17-alpine), named <app>-db, in the app's Coolify project. It isn't public, it starts at 256 MB, and it's reached by its internal URL.
  • An app that needs a job queue (BullMQ, RQ) or a cache gets its own Valkey, named <app>-redis.
  • The shared event bus is separate, and only for messages between services.

Backups ​

Every database gets a Coolify scheduled backup:

SettingValue
When0 3 * * * (03:00 UTC daily)
Whereon the server, plus R2 (stu-infra-backups)
Kept on the server7 copies, at most 2 GB
Kept in R214 copies, at most 30 days and 1 GB

R2's own lifecycle rule also deletes anything older than 30 days, so nothing builds up there even if Coolify's clean-up misses something.

Check that backups are working:

  • "did last night's backups work?" in Claude Code
  • the backup history on the database in Coolify
  • infra r2, which shows R2 usage

Restoring ​

Restoring overwrites data. The order I follow:

  1. Take a fresh backup of the current state.
  2. Pick the backup to restore in Coolify (the database's Backups tab, then Import).
  3. Restore it, then check the app.

Claude will do this through the Coolify tools, but it asks first and says exactly what will be overwritten.

Server snapshots ​

Database backups protect data. Server snapshots protect the whole server. They're different tools, and both are needed.