Create a bucket in Object Storage Service (OSS). A bucket is a container for objects. Create a bucket before uploading objects to OSS.
Usage notes
Creating a bucket requires the
oss:PutBucketpermission. For more information, see Attach a custom policy to a RAM user.For ossutil 1.6.16 and later, use
ossutilas the binary name on all operating systems. For earlier versions, update the binary name based on your operating system. For more information, see ossutil command reference.Starting from 10:00 (UTC+8) on October 13, 2025, OSS enables Block Public Access by default for new buckets created through the API, OSS SDKs, or ossutil. This phased adjustment applies to all regions. For the schedule of each region, see [Official Announcement] Adjustment to Public Access Blocking Configurations for Newly Created Buckets. After Block Public Access is enabled, public access permissions such as public ACLs (public-read and public-read-write) and bucket policies that allow public access cannot be configured. To allow public access, disable this feature after bucket creation.
Create a bucket by specifying options in the command
Command syntax
ossutil mb oss://bucketname
[--acl <value>]
[--storage-class <value>]
[--redundancy-type <value>]The following table describes the parameters and options.
| Parameter/Option | Description |
|---|---|
| bucketname | The name of the bucket. Bucket names must be globally unique within OSS. The name cannot be changed after creation. |
| --acl | The access control list (ACL) of the bucket. Valid values:
|
| --storage-class | The storage class of the bucket. Valid values:
Note OSS on CloudBox supports only the Standard storage class. For more information about storage classes, see Storage classes. |
| --redundancy-type | The redundancy type of the bucket. Valid values:
Important
|
Examples
Create a bucket named examplebucket: If no region is specified, the bucket is created in the region mapped to the endpoint in the ossutil configuration file. For example, if the endpoint is
https://oss-cn-hangzhou.aliyuncs.com, the bucket is created in China (Hangzhou).ossutil mb oss://examplebucketCreate a bucket named examplebucket with the ACL set to private, the storage class set to IA, and the redundancy type set to ZRS:
ossutil mb oss://examplebucket --acl private --storage-class IA --redundancy-type ZRSOn success, the output is similar to:
0.335189(s) elapsed
Create a bucket based on an XML file specified in the command
Command syntax
ossutil mb oss://bucketname local_xml_fileThe following table describes the parameters.
| Parameter | Description |
|---|---|
| bucketname | The name of the bucket. |
| local_xml_file | The path to a local XML file that contains bucket configurations. Example: localfile.xml. |
Examples
Define bucket configurations in an XML file named
localfile.xml:<?xml version="1.0" encoding="UTF-8"?> <CreateBucketConfiguration> <StorageClass>IA</StorageClass> <DataRedundancyType>LRS</DataRedundancyType> </CreateBucketConfiguration>Create a bucket from the local XML file:
ossutil mb oss://examplebucket localfile.xml
Common options
To create a bucket in a different region, use the -e option to specify the endpoint of that region. To create a bucket under a different Alibaba Cloud account, use the -i option for the AccessKey ID and the -k option for the AccessKey secret.
For example, create a bucket named examplebucket in China (Shanghai) under a different Alibaba Cloud account:
ossutil mb oss://examplebucket -e oss-cn-shanghai.aliyuncs.com -i yourAccessKeyID -k yourAccessKeySecretFor more information about common options, see Common options.