---
title: ALTER BUCKET
description: The ALTER BUCKET statement enables you to update an existing
  bucket's configuration.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbaselabs/docs-devex/edit/capella/modules/n1ql/pages/n1ql-language-reference/alterbucket.adoc
  xref: xref:cloud:n1ql:n1ql-language-reference/alterbucket.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/cloud/n1ql/n1ql-language-reference/alterbucket.html)

# ALTER BUCKET

> The ALTER BUCKET statement enables you to update an existing bucket's configuration. 

## [](#purpose)Purpose

Use the ALTER BUCKET statement to modify the configuration of a bucket in your Couchbase cluster. You can update only a limited set of bucket settings. You cannot change its core properties such as the bucket name and type. For more information, see the [Syntax](#alterbucket-syntax) section.

## [](#prerequisites)Prerequisites

To execute this statement in the Capella UI, you must have one of the following roles:

* [Organization Owner](../../organizations/organization-user-roles.md#organization-role-organization-owner)
* [Project Owner](../../projects/project-roles.md#project-owner-role)
* [Data Writer](../../projects/project-roles.md#project-cluster-data-reader-writer)

> [!NOTE]
> You cannot execute this statement using [cluster access credentials](../../clusters/cluster-rbac.md).

## [](#alterbucket-syntax)Syntax

```ebnf
alter-bucket ::= 'ALTER' ( 'BUCKET' | 'DATABASE' ) name ( 'WITH' with-fields )?
```

![Syntax diagram: refer to source code listing](../_images/n1ql-language-reference/alter-bucket.png) 

The `BUCKET` and `DATABASE` keywords are synonyms. You can use either of them.

| name        | (Required) An [identifier](identifiers.md) that represents the name of the bucket that you want to update.                                                                                                                                                                   |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| with-fields | (Optional) A JSON object containing a list of name-value pairs that specify additional options for the bucket. For a list of valid fields names and values, see [Bucket Parameter Groups](#rest-api:rest-bucket-create.adoc#parameter-groups) in the REST API documentation. |

> [!NOTE]
> You cannot alter the following fields of a bucket: `bucketType`, `storageBackend`, `replicaIndex`, and `conflictResolutionType`.

## [](#example)Example

Example 1\. Alter a bucket and update its memory quota, maximum TTL, and durability level

```sqlpp
ALTER BUCKET `student-records`
WITH {
    "ramQuota": 256,
    "maxTTL": 86400,
    "durabilityMinLevel": "majority"
};
```

## [](#related-links)Related Links

* For an overview of buckets, see [Buckets](#learn:buckets-memory-and-storage/buckets.adoc).
* For step-by-step procedures for bucket management, see [Manage Buckets](#manage:manage-buckets/bucket-management-overview.adoc).
* For managing buckets with the REST API, see [Buckets API](#rest-api:rest-bucket-intro.adoc).