content/influxdb/v2/admin/buckets/create-bucket.md
Use the InfluxDB user interface (UI), the influx command line interface (CLI),
or the InfluxDB API to create a bucket.
{{% note %}}
A single InfluxDB {{< current-version >}} OSS instance supports approximately 20 buckets actively being written to or queried across all organizations depending on the use case. Any more than that can adversely affect performance. {{% /note %}}
{{< tabs-wrapper >}} {{% tabs %}} InfluxDB UI influx CLI InfluxDB API {{% /tabs %}}
<!------------------------------ BEGIN UI CONTENT ----------------------------->{{% tab-content %}}
There are two places you can create a bucket in the UI.
In the navigation menu on the left, select Data (Load Data) > Buckets.
{{< nav-icon "data" >}}
Click {{< icon "plus" >}} Create Bucket in the upper right.
Enter a Name for the bucket (see Bucket naming restrictions).
Select when to Delete Data:
Click Create to create the bucket.
In the navigation menu on the left, select Explore (Data Explorer).
{{< nav-icon "data-explorer" >}}
In the From panel in the Flux Builder, select + Create Bucket.
Enter a Name for the bucket (see Bucket naming restrictions).
Select when to Delete Data:
Click Create to create the bucket.
{{% /tab-content %}}
<!------------------------------- END UI CONTENT ------------------------------> <!----------------------------- BEGIN CLI CONTENT ----------------------------->{{% tab-content %}}
Use the influx bucket create command
to create a new bucket.
Include the following flags with the command:
-n, --name: Bucket name
(see Bucket naming restrictions)
-o, --org or --org-id: Organization name or ID
-r, --retention: Bucket retention period (duration to keep data) in one of the following units:
ns)us or µs)ms)s)m)h)d)w){{% note %}} The minimum retention period is one hour. {{% /note %}}
# Syntax
influx bucket create \
--name <bucket-name> \
--org <org-name> \
--retention <retention-period-duration>
# Example
influx bucket create \
--name my-bucket \
--org my-org \
--retention 72h
{{% /tab-content %}}
<!------------------------------ END CLI CONTENT ------------------------------> <!----------------------------- BEGIN API CONTENT ----------------------------->{{% tab-content %}}
To create a bucket with the InfluxDB HTTP API, send a request to the following endpoint:
{{< api-endpoint method="post" endpoint="https://localhost:8086/api/v2/buckets" api-ref="/influxdb/v2/api/#operation/PostBuckets" >}}
Include the following in your request:
Token scheme with your InfluxDB API tokenapplication/jsonThe URL depends on the version and location of your InfluxDB {{< current-version >}} instance (see InfluxDB URLs).
{{% get-shared-text "api/v2.0/buckets/oss/create.sh" %}}
For information about InfluxDB API options and response codes, see InfluxDB API Buckets documentation.
{{% /tab-content %}}
<!------------------------------ END API CONTENT ------------------------------>{{< /tabs-wrapper >}}
Bucket names must adhere to the following naming restrictions:
_)")