---
slug: object-versioning-lifecycle-policies
published: 2026-12-01
change_type: new-feature
affected_products:
  - Storage
  - supabase-js
page: https://supabase.com/changelog/object-versioning-lifecycle-policies
---

# Supabase Storage: Versioning (Public Alpha)

## What's new

<img width="1280" height="963" alt="Studio bucket settings with object versioning and a lifecycle policy, next to a file's Versions panel with Restore version as current" src="https://supabase.com/dashboard/img/previews/storage-object-versioning.png" />

Object Versioning is a per-bucket setting for Supabase Storage. Any project can turn it on. With versioning on:

- An overwrite keeps the previous version of the file as a noncurrent version.
- A delete adds a delete marker and keeps the file's versions. The path returns `not_found`, as before, and you can bring the file back.
- Every version has a `versionId`. List, download, restore, or permanently delete a version from the Dashboard, `supabase-js` 2.116.0 or later, or the Storage API.

Lifecycle Policies are bucket rules that expire noncurrent versions after a set number of days. A rule can also keep a set number of the newest noncurrent versions. In that case, a version expires only when it's past the age limit and outside that set.

You can turn on versioning for a bucket that already has files. Turning it on doesn't change or delete them, and from then on, overwriting or deleting a file keeps the old one as a version. One exception: if you later suspend versioning, writing to a file that existed before versioning was on permanently replaces that original. Versioning also only protects changes made after you turn it on, so overwrites and deletes from before then can't be recovered. Nothing changes in how you upload, overwrite, or delete files, and buckets with versioning off behave exactly as they do today.

On self-hosted Supabase, versioning is off by default. Set `STORAGE_VERSIONING_ENABLED=true` on the Storage server to turn it on.

Kept versions count toward your Storage usage. See [pricing](https://supabase.com/pricing) for included storage and overage rates.

## How to use it

Turn on versioning for a bucket:

```js
await supabase.storage.updateBucket('avatars', {
  public: false,
  versioningStatus: 'ENABLED',
})
```

List a file's versions, then restore one by moving it onto its own path:

```js
const { data, error } = await supabase.storage.from('avatars').list('sidney/profile.png', {
  exactMatch: true,
  noncurrentVersions: 'include',
  deleteMarkers: 'include',
})

await supabase.storage
  .from('avatars')
  .move('sidney/profile.png', 'sidney/profile.png', {
    sourceVersionId: 'eaa8bdb5-2e00-4767-b5a9-d2502efe2196',
  })
```

Undo a delete by deleting the delete marker that's the current version. The version underneath becomes current again:

```js
await supabase.storage
  .from('avatars')
  .remove([{ path: 'sidney/profile.png', versionId: 'DELETE_MARKER_VERSION_ID' }])
```

Expire a noncurrent version only when it's older than 30 days and isn't one of the five newest noncurrent versions:

```js
await supabase.storage.updateBucketLifecycle('avatars', {
  rules: [
    {
      status: 'Enabled',
      filter: {},
      noncurrentVersionExpiration: { noncurrentDays: 30, newerNoncurrentVersions: 5 },
    },
  ],
})
```

## Known limitations in Public Alpha

- The S3-compatible endpoint works on versioned buckets, but it can't target a specific version yet. Uploads, overwrites, copies, and deletes over S3 follow the bucket's versioning status, the same as the Storage API: an overwrite keeps the previous version, and a delete adds a delete marker. A GetObject, HeadObject, GetObjectAttributes, DeleteObject, DeleteObjects, CopyObject, or UploadPartCopy request that names a version ID fails with a `NotSupported` error instead of acting on the current version. ListObjectVersions isn't available over S3 yet and returns `NotImplemented`. You can still read and set a bucket's versioning status and lifecycle rules over S3. Use the Dashboard, `supabase-js`, or the Storage API to list, read, or restore versions.
- Lifecycle rules apply to the whole bucket and only expire noncurrent versions. Prefix and tag filters, current-version expiration, and incomplete multipart upload cleanup aren't supported yet.

We're working on version operations over S3 and more lifecycle rule types.

## Why we built this

Without versioning, file deletions and overwrites are final. If your app can't afford to lose a file to a scripting error or a rogue agent, Object Versioning gives you a way back. Lifecycle Policies help you automatically manage your prior versions so they don't grow unbounded and you don't have to delete them yourself.

## What we'd like to know from you

Object Versioning and Lifecycle Policies are in public alpha, so your feedback shapes what we build next. Share it in the [Object Versioning discussion on GitHub](https://github.com/orgs/supabase/discussions/categories/changelog). We'd like to know:

- What you use versioning for.
- Which S3 version operations you need first, if you use the S3-compatible endpoint.
- Which lifecycle rules you're missing, such as prefix filters or current-version expiration.
- Any bugs or surprises, good or bad.

That discussion replaces the earlier requests for Storage versioning in [#40482](https://github.com/orgs/supabase/discussions/40482) and [#8106](https://github.com/orgs/supabase/discussions/8106).
