Add support for S3 path prefix (subfolder) in backup destination #445

Closed
opened 2026-04-05 16:16:29 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pimpithecat on 11/1/2025

Currently, the S3 backup configuration in Postgresus only accepts a plain bucket name (e.g. mybucket).
For many setups, users need to store backups under a specific prefix or subfolder inside that bucket, for example:

s3://mybucket/server-a/

However, the current implementation doesn’t seem to allow defining a subfolder or prefix — backups are uploaded directly into the bucket root.

Proposed behavior:

Allow defining an optional S3 path prefix for backups.
Example configurations:

Option 1 (separate prefix variable):

S3_BUCKET: mybucket
S3_PREFIX: server-a/

Option 2 (single variable with path support):

S3_BUCKET: mybucket/server-a

Both options should result in backups being stored in:

s3://mybucket/server-a/backup-2025-11-01.sql.gz

Why this matters:

  • Makes it possible to organize multiple servers’ backups in a single S3 bucket.
  • Prevents accidental overwriting between instances.
  • Matches behavior of other backup tools (Restic, Duplicati, Rclone, etc.).

Environment:

  • Postgresus version: latest (Docker image rostislavdugin/postgresus:latest)
  • Storage: S3 (tested with AWS S3)
  • OS: Ubuntu 22.04
*Originally created by @pimpithecat on 11/1/2025* Currently, the S3 backup configuration in Postgresus only accepts a plain bucket name (e.g. `mybucket`). For many setups, users need to store backups under a specific prefix or subfolder inside that bucket, for example: ``` s3://mybucket/server-a/ ``` However, the current implementation doesn’t seem to allow defining a subfolder or prefix — backups are uploaded directly into the bucket root. **Proposed behavior:** Allow defining an optional S3 path prefix for backups. Example configurations: Option 1 (separate prefix variable): ```yaml S3_BUCKET: mybucket S3_PREFIX: server-a/ ``` Option 2 (single variable with path support): ```yaml S3_BUCKET: mybucket/server-a ``` Both options should result in backups being stored in: ``` s3://mybucket/server-a/backup-2025-11-01.sql.gz ``` **Why this matters:** * Makes it possible to organize multiple servers’ backups in a single S3 bucket. * Prevents accidental overwriting between instances. * Matches behavior of other backup tools (Restic, Duplicati, Rclone, etc.). **Environment:** * Postgresus version: `latest` (Docker image `rostislavdugin/postgresus:latest`) * Storage: S3 (tested with AWS S3) * OS: Ubuntu 22.04
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#445