---
title: DROP BUCKET
description: The DROP BUCKET statement enables you to delete a bucket.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbaselabs/docs-devex/edit/capella/modules/n1ql/pages/n1ql-language-reference/dropbucket.adoc
  xref: xref:cloud:n1ql:n1ql-language-reference/dropbucket.adoc[]
---

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

# DROP BUCKET

> The DROP BUCKET statement enables you to delete a bucket. 

## [](#purpose)Purpose

Use the DROP BUCKET statement to permanently delete an existing bucket from your Couchbase cluster. Dropping a bucket deletes all data in the bucket, including documents, scopes, and collections. It also deletes all associated indexes, metadata, and other bucket resources.

> [!WARNING]
> This operation is irreversible, so use this statement with caution.

## [](#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).

## [](#syntax)Syntax

```ebnf
drop-bucket ::= 'DROP' ( 'BUCKET' | 'DATABASE' ) ('IF' 'EXISTS' )? name
```

![Syntax diagram: refer to source code listing](../_images/n1ql-language-reference/drop-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 delete. |
| ---- | ---------------------------------------------------------------------------------------------------------- |

### [](#if-exists)IF EXISTS Clause

The optional `IF EXISTS` clause enables the statement to complete successfully when the specified bucket doesn't exist. If a bucket with the same name does not exist, then:

* If this clause is not present, an error is generated.
* If this clause is present, the statement does nothing and completes without error.

## [](#examples)Examples

Example 1\. Drop a bucket named `student-records`

```sqlpp
DROP BUCKET `student-records`;
```

Example 2\. Drop a bucket named `custom-bucket` if it exists

```sqlpp
DROP BUCKET IF EXISTS `custom-bucket`;
```

## [](#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).