Updated on 2023-05-09 GMT+08:00

Creating a Bucket


You can use this command to create a bucket. A bucket name must be unique in OBS. One account can create a maximum of 100 buckets.

If you create a bucket and name it the same as an existing one in the same account and region, no error will be reported and status code 200 is returned. The bucket properties comply with those set in the first creation request. In other cases, creating a bucket with the same name as an existing one will receive the status code 409, indicating that the bucket already exists.

If the configured endpoint is a global domain name, you may need to wait several minutes before uploading objects to the created bucket. Therefore, set the endpoint to a regional domain name according to Performing the Initial Configuration if you want to upload objects instantly to the bucket.

Command Line Structure

  • In Windows
    obsutil mb obs://bucket [-fs] [-az=xxx] [-acl=xxx] [-sc=xxx] [-location=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
  • In Linux or macOS
    ./obsutil mb obs://bucket [-fs] [-az=xxx] [-acl=xxx] [-sc=xxx] [-location=xxx] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]


  • Take the Windows OS as an example. Run the obsutil mb obs://bucket-test command to create a bucket. The creation is successful.
    obsutil mb obs://bucket-test
    Create bucket [bucket-test] successfully, request id [0000016979E1D2EA860BB5E80A6B8FCC]
  • Take the Windows OS as an example. Run the obsutil mb obs://bucket001 command to create a namesake bucket. The creation fails.
    obsutil mb obs://bucket001
    Create bucket [bucket001] failed, http status [409], error code [BucketAlreadyExists], error message [The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.], request id [04030000016757F31A0333281A6B1E92]

Parameter Description


Optional or Mandatory




Bucket name

A bucket name must comply with the following rules:
  • Contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.), and starts with a digit or letter.
  • Cannot be an IP address.
  • Cannot start or end with a hyphen (-) or period (.).
  • Cannot contain two consecutive periods (.), for example, my..bucket.
  • Cannot contain periods (.) and hyphens (-) adjacent to each other, for example, my-.bucket or my.-bucket.


Optional (additional parameter)

Creates a parallel file system.


Optional (additional parameter)

Specifies a bucket's data redundancy policy. Possible values are:

  • multi-az

If multi-az is used, a bucket with the multi-AZ storage policy will be created. If this parameter is not specified, a bucket with the single-AZ storage policy will be created.


Optional (additional parameter)

Access control policies that can be specified when creating a bucket. Possible values are:

  • private
  • public-read
  • public-read-write

The preceding three values indicate private read and write, public read, and public read and write.


Optional (additional parameter)

Default bucket storage class that can be specified when creating a bucket. Possible values are:

  • standard: OBS Standard, which features low access latency and high throughput, and is applicable to storing frequently accessed data (multiple accesses per month) or data that is smaller than 1 MB
  • warm: OBS Infrequent Access. It is applicable to storing infrequently accessed (less than 12 times a year) data that requires quick response.
  • cold: OBS Archive. It is secure, durable, and inexpensive, and applicable to archiving rarely-accessed (once a year) data.


Mandatory unless the region where the OBS service resides is not the default region (additional parameter)

Region where the bucket resides.


This parameter indicates the region where a bucket will be created. It is mandatory only when the endpoint belongs to any other regions than the default one CN North-Beijing1 (cn-north-1). To view the currently valid regions, see Regions and Endpoints.


Optional (additional parameter)

User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description.


Optional (additional parameter)

Specifies the endpoint.


Optional (additional parameter)

Specifies the user's AK.


Optional (additional parameter)

Specifies the user's SK.


Optional (additional parameter)

Specifies the user's security token.