## What is it? `influx bucket create` is a command in the InfluxDB Command Line Interface (CLI) that creates a new bucket in the database. ## How to use it? - **Syntax**: `influx bucket create [flags]` - **Required CLI version**: 2.0.0+ - **Updated in**: CLI v2.1.0 ## Important Flags | Flag | Description | | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--name`, `-n` | Name of the new bucket | | `--org`, `-o` | Name of your organization (cannot be used with `--org-id`) | | `--org-id` | ID of your organization (cannot be used with `--org`) | | `--retention`, `-r` | Duration for which the bucket retains data; default is 0, i.e., infinite retention | | `--schema-type` | (Only for InfluxDB Cloud) Schema type of the bucket; can be either `explicit`(the default) or `implicit`; see [Manage Bucket Schema](https://docs.influxdata.com/influxdb/cloud/admin/buckets/bucket-schema/) for more information | ## Examples ```bash # Create a bucket with infinite retention influx bucket create --name example-bucket # Create a bucket that retains data for 30 days influx bucket create --name my_bucket --retention 30d # Create a bucket with a description influx bucket create --name my_bucket --description "This is my first InfluxDB Bucket" # Create a bucket with custom shard group duration (only supported in InfluxDB OSS) influx bucket create --name my_bucket --retention 30d --shard-group-duration 2d # Create an explicit schema type (only supported in InfluxDB Cloud) influx bucket create --name my_schema_bucket --schema-type explicit ``` Reference: - [influx bucket create | InfluxDB Cloud (TSM) Documentation (influxdata.com)](https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/bucket/create/)