S3 Backups
HitKeep can write both backups and retention archives to S3-compatible object storage.
Use this guide when you want:
- off-host backups
- object storage retention instead of local disks
- MinIO or R2 in self-hosted environments
What Uses S3
Section titled “What Uses S3”Two separate paths can point at S3-compatible storage:
HITKEEP_BACKUP_PATHforEXPORT DATABASEsnapshotsHITKEEP_ARCHIVE_PATHfor retention Parquet archives
They share the same S3 credential configuration.
Required Settings
Section titled “Required Settings”At minimum:
export HITKEEP_BACKUP_PATH=s3://my-bucket/hitkeep/backupsexport HITKEEP_S3_REGION=eu-central-1Static credentials:
export HITKEEP_S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLEexport HITKEEP_S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYOr rely on the AWS credential chain for IAM roles, ECS task roles, or similar.
AWS S3 Example
Section titled “AWS S3 Example”export HITKEEP_DATA_PATH=/var/lib/hitkeep/dataexport HITKEEP_BACKUP_PATH=s3://my-analytics-bucket/hitkeep/backupsexport HITKEEP_BACKUP_INTERVAL=60export HITKEEP_BACKUP_RETENTION=24export HITKEEP_S3_REGION=eu-central-1
./hitkeepMinIO Example
Section titled “MinIO Example”export HITKEEP_BACKUP_PATH=s3://hitkeep/backupsexport HITKEEP_ARCHIVE_PATH=s3://hitkeep/archiveexport HITKEEP_S3_ACCESS_KEY_ID=minioadminexport HITKEEP_S3_SECRET_ACCESS_KEY=minioadminexport HITKEEP_S3_ENDPOINT=localhost:9000export HITKEEP_S3_URL_STYLE=pathexport HITKEEP_S3_USE_SSL=falseexport HITKEEP_S3_REGION=us-east-1
./hitkeepCloudflare R2 Example
Section titled “Cloudflare R2 Example”export HITKEEP_BACKUP_PATH=s3://my-r2-bucket/hitkeep/backupsexport HITKEEP_S3_ACCESS_KEY_ID=YOUR_R2_ACCESS_KEYexport HITKEEP_S3_SECRET_ACCESS_KEY=YOUR_R2_SECRET_KEYexport HITKEEP_S3_ENDPOINT=YOUR_ACCOUNT_ID.r2.cloudflarestorage.comexport HITKEEP_S3_REGION=auto
./hitkeepBucket Layout
Section titled “Bucket Layout”Built-in backups use this logical layout:
s3://bucket/hitkeep/backups/ shared/ 2026-03-08T120000Z/ tenants/ 5c6644da-ef00-45e6-825d-c755d19d7f9f/ 2026-03-08T120000Z/Retention archives use your configured archive prefix and write Parquet objects there.
Retention on S3
Section titled “Retention on S3”For local backup destinations, HitKeep prunes older snapshots automatically based on HITKEEP_BACKUP_RETENTION.
For S3 destinations, prefer provider-side lifecycle rules:
- keep recent snapshots hot
- expire old snapshots automatically
- move older archives to cheaper storage classes if your provider supports it
That keeps retention behavior transparent and avoids a surprise cost curve in object storage.
Restore From S3
Section titled “Restore From S3”When restoring from S3, provide the exact snapshot timestamp:
./hitkeep recover restore-backup \ -from s3://my-analytics-bucket/hitkeep/backups \ -snapshot 2026-03-08T120000Z \ -s3-region eu-central-1 \ -yesUnlike local snapshots, HitKeep does not currently auto-discover “latest” from S3.
Common Mistakes
Section titled “Common Mistakes”- Using only
HITKEEP_ARCHIVE_PATHand assuming backups are enabled - Backing up only the shared DB while teams are enabled
- Forgetting
HITKEEP_S3_URL_STYLE=pathfor MinIO-style endpoints - Using HTTP endpoints without
HITKEEP_S3_USE_SSL=false - Assuming S3 restore can infer the latest snapshot automatically