MinIO Object Lock can stop protected backup versions from being permanently deleted through the S3 API before their retention expires. The safe VPS design puts the object store in a separate failure domain, gives the backup job no retention-bypass privilege, proves a version-specific delete is denied, and then completes a real restore drill.
Object Lock is not a force field around a server. If production and backup storage share one VPS, one disk, one root account or one provider account, losing that boundary can still destroy both copies. Immutability is one control inside a recovery design, not a substitute for isolation, monitoring and tested restores.
Use Object Lock when a backup client needs to write new archives but should not be able to erase retained versions. Start with governance mode in a test bucket, remove bypass power from the uploader identity, and move to compliance mode only when the retention commitment is understood and approved.
Before deploying MinIO specifically, check the current product path. The MinIO Community repository now says it is no longer maintained, lists AIStor Free and Enterprise alternatives, and describes Community Edition as source-only. That makes “download an old binary and forget it” a poor production plan. Choose a maintained distribution or S3-compatible service, document its license and support model, and verify its current Object Lock behavior.
| Decision | Safer answer | Why it matters |
|---|---|---|
| Backup endpoint location | Separate VPS, account or object-storage service | One production compromise should not own both data and repository |
| Initial retention mode | Governance with tightly held bypass rights | Lets a team validate retention before making an irreversible commitment |
| Backup-job identity | Upload/list/read only as required; no retention administration or bypass | Compromised application credentials should not unlock old versions |
| Retention duration | Derived from recovery needs and storage budget | Longer locks consume capacity and cannot be treated like free history |
| Success evidence | Denied permanent delete plus clean-room restore | A green backup log alone proves neither immutability nor recoverability |
S3 Object Lock applies a Write-Once Read-Many rule to individual object versions. The MinIO retention documentation and the AWS S3 Object Lock model both connect locking to versioning: new data can create a new version, while a retained earlier version cannot be permanently removed until its rule permits it.
That version detail explains a confusing test result. A simple delete request may succeed by creating a delete marker that hides the current object name. It does not necessarily erase the locked version underneath. A permanent delete that names a protected version ID should be denied.
| Mechanism | What it does | Operational caveat |
|---|---|---|
| Versioning | Preserves multiple object versions | Old versions still need retention and lifecycle planning |
| Governance retention | Blocks ordinary deletion and changes | A principal with bypass permission can override it deliberately |
| Compliance retention | Blocks deletion or shortening during the retention period | A mistaken duration can lock capacity longer than intended |
| Legal hold | Keeps a specific version locked without a fixed expiry | It requires a controlled process to remove the hold later |
| Lifecycle expiration | Cleans eligible current or non-current versions | Active retention takes precedence, so cleanup can be delayed |
Object Lock does not stop an attacker from deleting the storage VM, destroying its disk, closing the provider account, stealing a more powerful administrator identity or corrupting data before the backup job uploads it. It also does not guarantee that an application-consistent database snapshot was captured.
Running MinIO on the same VPS as the protected application may be useful for a lab, but it is not an independent backup. Root on that host controls the service process, storage path, credentials and network. Even perfect API retention cannot recover a disk that no longer exists.
A practical small-team layout has three boundaries:
Keep the MinIO/API endpoint private when possible. If it must be reached over the internet, use HTTPS with a valid certificate, narrow network policy where practical, current software and independent monitoring. Do not publish the administration console merely because the S3 API needs to be reachable.
The storage system also needs its own backup and durability story. A single MinIO process on one virtual disk is still one storage failure. Erasure coding, replication or provider durability can reduce that risk, but the exact design depends on the selected maintained product and the number of independent disks or nodes available.
For a workload that needs predictable disk and network capacity, storage-focused VPS hosting can be one infrastructure component. The protected copy should still sit outside the production machine and account boundary. If the source is WooCommerce, begin with an order-aware retention plan so the object-lock duration follows the store’s recovery window instead of an arbitrary round number.
Using the MinIO root account in a cron job defeats the main security boundary. The job normally needs to create objects, perhaps list them and read them for verification. It should not configure bucket retention, remove legal holds, administer users or bypass governance.
Build at least three identities:
Store the uploader secret in a root-owned file or secret manager, not inside the script, shell history, web root or application database. Rotate it independently from the retention administrator. If production is compromised, revoke the uploader after preserving logs; do not hand the compromised host a broader key just to make recovery convenient.
Complete a Linux VPS baseline before treating object storage as the first security control. Separate Unix accounts, current packages, narrow firewall exposure and readable service logs are still required.
The following mc sequence demonstrates the control plane without prescribing how to install MinIO. Follow the current documentation for the maintained MinIO/AIStor or compatible S3 service you selected. Run this against a disposable test bucket, not against production data.
From a protected administration workstation, load the separate retention-administrator credentials and configure an administrative alias:
export MINIO_ADMIN_ACCESS_KEY='REPLACE_WITH_RETENTION_ADMIN_KEY'
export MINIO_ADMIN_SECRET_KEY='REPLACE_WITH_RETENTION_ADMIN_SECRET'
mc alias set backupadmin https://s3-backup.example.com
"$MINIO_ADMIN_ACCESS_KEY" "$MINIO_ADMIN_SECRET_KEY"
mc admin info backupadmin
mc alias set stores credentials in the local client configuration, so use a controlled account with restrictive file permissions and remove the alias when the administration task is complete. Do not leave real values in shell history or a shared terminal transcript. The current mc mb reference documents --with-lock, which also enables versioning for a new bucket:
mc mb --with-lock backupadmin/vps-backup-test
mc retention set --default GOVERNANCE 30d backupadmin/vps-backup-test
mc retention info backupadmin/vps-backup-test
Thirty days is an example, not a universal policy. First model daily data volume, full-versus-incremental behavior, version growth, expected restore points and the cleanup delay after retention expires.
Now switch to the deliberately weaker uploader identity on the test backup client. It must not have governance-bypass or retention-administration permissions. Configure a separate alias, upload a harmless object and list its version information:
export MINIO_UPLOADER_ACCESS_KEY='REPLACE_WITH_UPLOAD_ONLY_KEY'
export MINIO_UPLOADER_SECRET_KEY='REPLACE_WITH_UPLOAD_ONLY_SECRET'
mc alias set backupwriter https://s3-backup.example.com
"$MINIO_UPLOADER_ACCESS_KEY" "$MINIO_UPLOADER_SECRET_KEY"
printf 'object-lock validation onlyn' > /tmp/object-lock-test.txt
mc cp /tmp/object-lock-test.txt backupwriter/vps-backup-test/
mc stat --versions backupwriter/vps-backup-test/object-lock-test.txt
Record the returned version ID. From the uploader identity, attempt to remove that exact test version:
mc rm --version-id 'REPLACE_WITH_TEST_VERSION_ID'
backupwriter/vps-backup-test/object-lock-test.txt
The expected result is a denial while retention is active. If deletion succeeds, stop: the object may not carry the expected retention, the client may be using a governance-bypass identity, or the chosen service may behave differently. Inspect the object version and policy rather than declaring the repository immutable.
Do not “test” compliance mode on a real bucket with an exaggerated duration. Unlike governance, compliance mode is designed so even highly privileged users cannot shorten or remove active retention through ordinary administration.
A denied delete proves only one control. The backup pipeline must also create usable, complete data.
For every protected workload, retain evidence for four stages:
| Stage | Evidence to record | Failure that it catches |
|---|---|---|
| Capture | Database/app exit status, timestamp and manifest | Partial or inconsistent source archive |
| Upload | Object key, version ID, size and checksum | Truncated transfer or wrong destination |
| Retention | Mode, retain-until time and denied version delete | Missing lock or excessive uploader privilege |
| Restore | Isolated destination, validation query and elapsed time | Unusable archive, missing secret or undocumented recovery step |
Restore into an isolated directory, database or staging VPS. Never overwrite production to prove a backup. Verify file checksums, database integrity, application-critical records and the time required to make the service usable. Then delete the restored test copy, not the retained source version.
Alert on failed uploads, unexpected object-count changes, expiring capacity, retention-policy changes, time drift and denied operations from identities that should never delete. Object Lock uses time-based expiry, so reliable system time and current provider guidance matter.
CISA’s ransomware guidance recommends offline encrypted backups and regular availability and integrity testing. A reachable immutable object store adds useful resistance to credential misuse, but it does not automatically satisfy the offline-copy recommendation. Keep another recovery path when the impact warrants it.
Retention changes deletion from an immediate storage operation into a future one. That is the point, but it means a bad capacity estimate can fill the repository while every old version is still protected.
Estimate at least:
Create capacity alerts well before the disk is full. A storage service that accepts no new backups has failed its purpose even if old objects remain perfectly immutable. Governance mode can help a team learn the real growth curve; compliance mode should follow only after those numbers and responsibilities are accepted.
| Situation | Fit | Reason |
|---|---|---|
| Application credentials might be stolen and used to delete backups | Good with scoped IAM | Retained versions can reject permanent deletion by the uploader |
| Production and backup use separate accounts or providers | Good | The design has a meaningful administrative failure boundary |
| Backup store is on the same VPS and disk as production | Poor | Host or disk destruction bypasses API retention entirely |
| Team needs to evaluate policy before committing | Governance first | Bypass can be tightly reserved while tests expose mistakes |
| Regulated retention requires formal assurance | Specialist review required | Product features alone do not certify architecture, procedures or compliance |
| No one can monitor capacity, updates and restore drills | Poor DIY fit | Immutability creates operational duties rather than removing them |
The honest limitation is that MinIO Object Lock protects a precise layer: retained object versions and the API permissions around them. It becomes valuable when the storage service is maintained, isolated and observable. It becomes false safety when the same administrator credential or VPS still controls every copy.
Teams that do not want to own S3 policy, updates, storage growth and recovery exercises should compare a managed object-storage service or managed infrastructure support with the cost of operating the full boundary themselves.
Choose the maintained MinIO/AIStor or S3-compatible path first. Build a disposable locked bucket in governance mode, separate uploader and retention credentials, upload one test object, prove a version-specific delete is denied, and restore that object through the documented recovery identity. Only after this evidence should production backups receive a retention policy.
The current MinIO repository says it is no longer maintained and describes Community Edition as source-only, with historical binaries no longer receiving updates. Review AIStor Free/Enterprise or another maintained S3-compatible service before production use.
No. It can prevent retained object versions from being deleted through authorized S3 operations. It does not protect a shared VPS, disk, provider account, administrator identity or data corrupted before upload.
Governance is the safer starting point for testing because a tightly controlled privileged identity can bypass it. Compliance is for an accepted retention commitment that must not be shortened casually, even by an administrator.
A simple delete can create a delete marker in a versioned bucket while the protected version remains. Test a version-specific permanent delete and inspect the version list before deciding whether retention failed.
It should not. Give the uploader only the actions needed to write and verify backups, while a separate administrator controls retention, legal holds and any governance-bypass privilege.
Base it on recovery objectives, incident-discovery time, legal requirements and measured storage growth. Model lifecycle delay and capacity before applying a long period.
No. Restore a selected version into an isolated environment, verify its checksum and application data, record elapsed recovery time, and confirm the required credentials are available outside production.