--- title: "Set a default object lock on a bucket" description: "Set, change, or remove the default governance lock on a TIR Object Storage bucket created with object lock, so every new object keeps a retention period." content_type: "how-to" product: "tir-object-storage" platform: "TIR" url: "/tir/tir-object-storage/how-to/set-a-default-object-lock/" topic: ["protect-and-manage"] --- # Set a default object lock on a bucket Object lock keeps a locked object version from being overwritten or deleted until its retention ends. The default lock puts a retention on every new object uploaded to the bucket. ## Before you begin - A bucket created with **Enable Object Lock**. You can turn object lock on only while you create the bucket. To get it on an existing bucket, create a new bucket with object lock and copy the objects across. See [Create a bucket](/tir/tir-object-storage/how-to/create-a-bucket/). On a bucket created with object lock off, the **Object Lock** tab shows "Object lock is not enabled on this bucket". - Permission to update datasets in the project. A Member gets it through a policy that allows updating datasets. ## Set the default retention Object lock supports the governance mode only. 1. In the list, select the bucket's row and open the **Object Lock** tab. 2. Tick **Enable Governance Lock on the objects of this bucket**. 3. Enter the **Retention period** in days, from 1 to 36,500. Any other value shows "Enter a value between 1 and 36500". 4. Select **Save**. The tab then shows "Governance Lock is enabled on this bucket" and the **Retention period**. The retention counts from the upload date and applies to new objects only. When you change it, objects already stored and objects already under another retention stay as they are. ## Change or remove the default lock To change the retention period, edit it on the **Object Lock** tab. To remove the lock, select **Remove Lock** and confirm. The default lock then stops applying to new uploads, and the portal shows "Governance lock removed successfully". Versions that already took a retention keep it, and you can still set a custom lock on a single version. Remove the default lock before you delete the bucket. To lock one version, see [Lock one object version or place a legal hold](/tir/tir-object-storage/how-to/lock-an-object-version/). For help with a message, see [Troubleshooting TIR Object Storage](/tir/tir-object-storage/troubleshooting/tir-object-storage/).