# How do I turn on S3 versioning?

> Turn on S3 versioning with the AWS CLI or rclone, restore an old version, expire old ones with a lifecycle rule. Commands from the official docs.

- URL: https://privates3.com/guides/how-to-turn-on-s3-versioning/
- Last updated: 2026-11-17
- Publisher: PrivateS3 (https://privates3.com)

**Quick answer — How do I turn on S3 versioning?**

Run `aws s3api put-bucket-versioning --bucket BUCKET --versioning-configuration Status=Enabled`, or `rclone backend versioning remote:BUCKET Enabled`. From then on, overwrites and deletes keep the old version. On a **PrivateS3** bucket versioning is self-service and free, but every old version counts toward the plan's quota, from 1 TB.

**In brief**

- **Three states**: unversioned (default), Enabled, Suspended; once enabled, a bucket never returns to unversioned, per rclone's docs.
- **Delete with versioning** adds a delete marker; the data stays as an older version.
- **Cost**: AWS says each version is the whole object, billed in full. At PrivateS3: S3 versioning can be turned on per bucket from any S3 client; old versions count toward the quota.
- **Cleanup**: a lifecycle rule expires noncurrent versions after N days.

## What changes for an object when versioning is on?

*Effect of upload and delete on an S3 object with and without versioning, per the Amazon S3 user guide*

| Action | Unversioned | Versioning enabled |
| --- | --- | --- |
| Upload over an existing key | Old data replaced | New version added; old one kept as noncurrent |
| Delete without a version ID | Object removed | Delete marker added; versions kept |
| Delete with a version ID | — | That version removed for good |
| Version ID of new objects | null | Unique ID |

## How do you turn versioning on with the AWS CLI?

**Send `put-bucket-versioning` with `Status=Enabled` to the bucket, using the seller's endpoint.** The AWS CLI reference, read on 17 November 2026, gives this command and notes that a bucket with versioning set can only be Enabled or Suspended afterwards. The endpoint and region are shown with the keys in the client area.

AWS recommends waiting 15 minutes after the first activation before writing to the bucket, since the change can take time to spread on Amazon S3.

*Enable, then check*

```bash
aws s3api put-bucket-versioning \
  --bucket BUCKET \
  --versioning-configuration Status=Enabled \
  --endpoint-url https://s3.privates3.com

aws s3api get-bucket-versioning --bucket BUCKET --endpoint-url https://s3.privates3.com
```

## How do you turn versioning on with rclone?

**Use the S3 backend command `rclone backend versioning`.** The rclone S3 docs say that without an argument it reports the status, and with `Enabled` or `Suspended` it sets it first. They also document `--s3-versions` to show old versions in listings and `--s3-version-at` to see the bucket as it was at a date. The [rclone page](https://privates3.com/rclone-cloud-storage/ "How do I set up an rclone S3 remote for cloud storage?") sets up the `privates3` remote.

*rclone versioning commands*

```bash
rclone backend versioning privates3:BUCKET           # read status
rclone backend versioning privates3:BUCKET Enabled   # turn on

rclone ls privates3:BUCKET --s3-versions             # list old versions too
rclone ls privates3:BUCKET --s3-version-at 2026-11-10
```

## How do you find and restore an old version?

**List the versions of the key, then download the one you want by its version ID.** The AWS CLI's `list-object-versions` returns `Versions` and `DeleteMarkers`, each with a `VersionId` and an `IsLatest` flag. The S3 user guide says a GET with a version ID returns that version even when a delete marker is current.

In Cyberduck, View → Show Hidden Files shows old versions and File → Revert restores one; the [Cyberduck guide](https://privates3.com/guides/how-to-connect-cyberduck-to-s3/ "How do I connect Cyberduck to S3-compatible storage?") has the details.

*List versions of one key, then fetch an old one*

```bash
aws s3api list-object-versions --bucket BUCKET --prefix reports/q3.xlsx \
  --endpoint-url https://s3.privates3.com

aws s3api get-object --bucket BUCKET --key reports/q3.xlsx \
  --version-id VERSION_ID q3-restored.xlsx --endpoint-url https://s3.privates3.com
```

## How do you stop old versions from filling the quota?

**Add a lifecycle rule that expires noncurrent versions after a number of days.** The AWS CLI reference for `put-bucket-lifecycle-configuration` documents `NoncurrentVersionExpiration` with `NoncurrentDays` and `NewerNoncurrentVersions`. The rule below deletes versions 30 days after they stop being current, while always keeping the 3 newest.

This matters at PrivateS3, where the quota is hard: The plan size is a hard quota: an upload that would pass it is refused with a QuotaExceeded error, nothing is billed on top. Do not add this rule to a bucket used by Veeam: Veeam's help center says lifecycle rules are not supported there. According to PrivateS3's survey of 17 November 2026, PrivateS3 bills no early-deletion fee, so expiring versions frees quota at once.

*lifecycle.json and the command that applies it*

```bash
cat > lifecycle.json <<'EOF'
{
  "Rules": [
    {
      "ID": "expire-old-versions",
      "Filter": { "Prefix": "" },
      "Status": "Enabled",
      "NoncurrentVersionExpiration": { "NoncurrentDays": 30, "NewerNoncurrentVersions": 3 }
    }
  ]
}
EOF

aws s3api put-bucket-lifecycle-configuration --bucket BUCKET \
  --lifecycle-configuration file://lifecycle.json --endpoint-url https://s3.privates3.com
```

## S3 versioning: common questions

### Can I turn versioning off again?

You can suspend it, not remove it. Existing versions stay until you delete them or a lifecycle rule expires them.

### Is versioning the same as Object Lock?

No. Versioning keeps old copies, but anyone with the keys can delete them. Object Lock blocks deletion until a date; Object Lock (immutable backups) is set on a new bucket on request through a support ticket.

### Do old versions cost extra at PrivateS3?

No separate fee, but they use quota. AWS's guide notes each version is a full copy, not a diff.

### Does restic need bucket versioning?

No, restic keeps its own snapshots. Versioning adds protection if the server holding the keys is compromised.

### What does a delete marker look like in the listing?

`list-object-versions` shows it under `DeleteMarkers` with `IsLatest: true`; a plain GET then returns 404 Not Found.

**Verdict**

- **One command turns versioning on**, and a lifecycle rule keeps it from eating the quota.
- **For backups that must survive a hacked server**, pair it with Object Lock, set on a new PrivateS3 bucket by ticket. See [server backup storage](https://privates3.com/server-backup-storage/ "Where should I store server backups off-site?").

## Sources

1. [put-bucket-versioning](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-versioning.html) — AWS CLI Command Reference (read 17 November 2026)
2. [list-object-versions](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-object-versions.html) — AWS CLI Command Reference (read 17 November 2026)
3. [put-bucket-lifecycle-configuration](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-lifecycle-configuration.html) — AWS CLI Command Reference (read 17 November 2026)
4. [How S3 Versioning works](https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) — Amazon Web Services (read 17 November 2026)
5. [Amazon S3 Storage Providers (versioning commands)](https://rclone.org/s3/) — rclone (read 17 November 2026)
6. [Amazon S3 (versions in Cyberduck)](https://docs.cyberduck.io/protocols/s3/) — Cyberduck documentation (read 17 November 2026)
7. [S3 Compatible Object Storage Considerations and Limitations](https://helpcenter.veeam.com/docs/vbr/userguide/s3_compatible_limitations.html) — Veeam Help Center (read 17 November 2026)

**A versioned bucket for backups: 5 TB for 12 months, $133.87** Versioning and lifecycle rules from any S3 client, paid in crypto. [Get a bucket](https://privates3.com/app/checkout/?plan=s3-5t-12m&product=storage&from=how-to-turn-on-s3-versioning&lang=en)

---

PrivateS3: PrivateS3 sells S3-compatible object storage billed per terabyte for backups and files (restic, rclone, Veeam, Cyberduck, Nextcloud), meant to be encrypted on the customer's side before upload. A terabyte costs $5.40 a month or $26.77 for 12 months, 10% under the lowest comparable offer read on 17 November 2026, with no API or egress fees up to 3 times the stored size, paid in crypto with no ID document.
