How to back up a MinIO Docker container (2026)
MinIO needs a consistent dump before it touches restic. Dockstash runs `mc mirror local/<bucket> /backup/<bucket>` inside the container, captures the output, and stores it encrypted off-site — it never copies /data live, because mc mirror copies each object atomically through the S3 API, preserving metadata that a raw /data copy can miss during in-flight multipart uploads.
What Dockstash detects
| Env keys detected | MINIO_ROOT_USER, MINIO_ROOT_PASSWORD, MINIO_ACCESS_KEY, MINIO_SECRET_KEY |
|---|---|
| Default port | 9000 |
| Live data paths (never copied live) | /data |
| Example images | minio/minio:latest, minio/minio, quay.io/minio/minio |
The dump command
mc mirror local/<bucket> /backup/<bucket>The restore command
mc mirror /backup/<bucket> local/<bucket>mc mirror copies each object atomically through the S3 API, preserving metadata that a raw /data copy can miss during in-flight multipart uploads.
Gotchas to avoid
- Prefer mc mirror over copying the raw /data directory — MinIO stores objects plus xl.meta metadata, and a raw copy can miss in-flight multipart uploads.
- Mirror through the S3 API so object metadata, versions, and tags are preserved consistently.
- For versioned buckets, replicate versions explicitly or you capture only the latest object state.
Do it in one click with Dockstash
Dockstash runs the exact dump above, restics it off-site, and drill-tests the restore automatically — no script to maintain.
Last updated: July 2026
Frequently asked questions
Should I back up MinIO with mc mirror or a file copy?
Use mc mirror. It reads objects through the S3 API so each object and its metadata are captured atomically. A raw /data copy can catch in-flight multipart uploads or miss metadata layout.
Does mc mirror preserve versions and tags?
It preserves object metadata and tags. For versioned buckets you need to mirror versions explicitly, otherwise only the current version of each object is captured.
Can I restore into a fresh MinIO instance?
Yes. Point mc at the new instance, create the target bucket, and mirror the backup directory back. Dockstash restics the mirrored objects between steps.
Is copying /data ever acceptable?
Only with MinIO fully stopped and no writes in flight, and even then metadata layout must be preserved exactly. The API-level mirror is the safer, supported approach.