• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide (S3cmd)
  4. Operation Guide
  5. Bucket Management
  6. Creating a Bucket

Creating a Bucket

This section helps you use S3cmd to create an OBS bucket.

Prerequisites

You have installed and configured S3cmd.

Procedure

  1. Open the command line tool.
  2. Run the following command to create an OBS bucket:

    s3cmd mb s3://my-bucket

    NOTE:

    my-bucket is the name of the bucket that you want to create. The name of each bucket is globally unique on OBS and complies 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
    If the following command output is displayed, it indicates that an OBS bucket is successfully created.
    Bucket 's3://my-bucket/' created

  3. (Optional) Run the following command to obtain the bucket list and check whether the name of the newly created bucket is in the bucket list:

    s3cmd ls