tencent cloud

Creating Buckets - mb
Last updated: 2025-11-14 15:30:16
Creating Buckets - mb
Last updated: 2025-11-14 15:30:16
The mb command is used to create a bucket.
Note:
If you need to use this command, when you perform authorization policy, set action to cos:PutBucket. For more authorizations, please refer to CAM-Enabled API.

Command format

./coscli mb cos://<BucketName-APPID> -e <endpoint> [flag]
Note:
To create a bucket using the mb command, you need to carry the global flag -e or --endpoint to specify the region where the bucket is located.
mb includes the following parameters:
Parameter Format
Description
Sample
cos://<BucketName-APPID>
Customizes the bucket name
cos://examplebucket-1250000000
mb includes the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
Views the usage of this command.
-r
--region
Region of the bucket.
-m
--maz
Create a multi-az bucket
-o
--ofs
Create a bucket for ofs
None
--acl
Set the ACL of the bucket, such as private, public-read, and public-read-write.
None
--grant-read
Grant the authorized entity permission to read the bucket. The format is id="[OwnerUin]", for example id="100000000001". Use comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002".
None
--grant-read-acp
Grant the authorized entity permission to read the bucket's access control list (ACL). The format is id="[OwnerUin]", for example id="100000000001". Use comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002".
None
--grant-write-acp
Grant the authorized entity permission to write to the bucket's access control list (ACL). The format is id="[OwnerUin]", for example id="100000000001". Use comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002".
None
--grant-full-control
Grant the authorized entity all permissions to operate the bucket. The format is id="[OwnerUin]", for example id="100000000001". Use comma (half-width) to separate multiple authorized entities, such as id="100000000001",id="100000000002".
None
--tags
Bucket tag collection, with a maximum of 50 tags (for example, --tags="Key1=Value1&Key2=Value2")
Note:
After you run the mb command to successfully create a bucket, we recommend that you add information about the bucket in the configuration file, so that you can use the bucket alias for quick operations. For command usage, see the following example.
For more general options for this command (such as switching buckets or user accounts), see General Options.

Sample:Create the bucket3-1250000000

./coscli mb cos://bucket3-1250000000 -e cos.ap-chengdu.myqcloud.com
If you want to configure an alias for the bucket you just created, update the configuration file with the following command:
./coscli config add -b bucket3-1250000000 -e cos.ap-chengdu.myqcloud.com -a bucket3
After the update, you can access the bucket at cos://bucket3.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback