Updated on 2025-12-16 GMT+08:00

Creating a Bucket

You can use OBS Console, SDKs, OBS Browser+, obsutil, or APIs to create a bucket. A bucket is a container that stores objects in OBS. Before you can store data in OBS, you must create a bucket.

Prerequisites

You have created an account, added a valid payment method, and obtained access keys (AK and SK) and endpoints. For details, see Getting Started.

Constraints

  • Once a bucket is created, its name and region cannot be changed. Make sure that the bucket name and region you set are appropriate.
  • An account (and all its IAM users) can create a maximum of 100 buckets. You are advised to use the fine-grained access control of OBS to properly plan and use buckets. For example, you can create folders in a bucket based on object prefixes and use fine-grained access control to isolate data between departments. There is no limit to the total number or size of objects in a bucket, so scalability is not a concern.
  • OBS buckets are global resources, so each bucket name must be unique across all users, including your own.

    To reuse the name of a deleted bucket for another bucket, you must wait until the bucket name is released. Deleting a bucket via API takes about 30 minutes. However, the process may take longer if the bucket is not empty, or if the account is in arrears or has been deregistered. OBS cannot guarantee immediate deletion. Therefore, if you attempt to create a new bucket using a name that has not been released, the creation will fail. Similarly, if the name is released but claimed by another user before you reuse it, the creation will also fail.

Bucket Naming Rules

A bucket name is part of the access domain name and needs to be resolved. Therefore, a bucket name must comply with the DNS domain naming rules. After receiving a bucket creation request, OBS strictly checks the bucket name. A bucket name:
  • Must be globally unique. It cannot be the same as any existing bucket name, including those created by other users. You must wait at least 30 minutes before you can reuse the name of a deleted bucket or parallel file system, or the creation will fail.
  • Must be 3 to 63 characters long. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.
  • Cannot start or end with a period (.) or hyphen (-). It also cannot contain two consecutive periods (..) or contain a period (.) and a hyphen (-) adjacent to each other.
  • Cannot be formatted as an IP address.

Bucket Naming Best Practices

  • Avoid using periods (.) in bucket names. Wildcard SSL certificates only work with bucket names that do not contain periods (.). If a bucket has periods (.) in its name, accessing the bucket domain name (bucketname.obs.regionID.myhuaweicloud.com) over HTTPS will fail or trigger a certificate verification warning, for example, a red security alert in the browser.
  • Avoid using sensitive information in bucket names. A bucket name will be part of the URL of an object in the bucket.
  • Choose a naming rule that can avoid conflicts. Ensure that your program will select another bucket name when the bucket name has been used.

Ways to Create a Bucket

You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to create a bucket.

References