A bucket is a container for objects stored in Object Storage Service (OSS). You must create a bucket before you upload an object to OSS. This topic describes how to create a bucket by using the mb command.
Usage notes
-
To create a bucket, you must have the oss:PutBucket permission. For more information, see Grant a custom policy.
-
Starting at 10:00:00 (UTC+8) on October 13, 2025, OSS gradually enables Block public access by default for buckets that are created by calling API operations or by using OSS SDKs or ossutil in all regions. For the time when the change takes effect in each region, see Announcement. After this feature is enabled, you cannot grant public access permissions, including the public-read or public-read-write ACL and bucket policies that allow public access. If your business requires public access, you can disable block public access after the bucket is created.
Command syntax
ossutil mb oss://bucket [flags]
|
Option |
Type |
Description |
|
--acl |
string |
The access control list (ACL) of the bucket. Valid values:
|
|
--redundancy-type |
string |
The redundancy type of the bucket. Valid values:
|
|
--resource-group-id |
string |
The ID of the resource group. |
|
--storage-class |
string |
The storage class of the bucket. Valid values:
|
For more information, see Command-line options.
Examples
-
Create a bucket named examplebucket whose ACL is private.
ossutil mb oss://examplebucket --acl=private -
Create a bucket named examplebucket whose ACL is private and resource group is rg-aek27tc****.
ossutil mb oss://examplebucket --acl=private --resource-group-id rg-aek27tc****