All Products
Search
Document Center

Object Storage Service:Create a bucket

Last Updated:Mar 17, 2026

Create an Object Storage Service (OSS) bucket in a specified region using the ossutil api put-bucket command. By default, new buckets use Standard storage, locally redundant storage (LRS), and private access control list (ACL).

Important

Since October 13, 2025 (10:00 UTC+8), new buckets created through the API, SDKs, or ossutil have Block Public Access enabled by default. Public ACLs (public-read, public-read-write) and bucket policies that grant public access are blocked. To allow public access, disable Block Public Access after the bucket is created. This change is rolling out in phases across all regions. For the rollout schedule, see Block Public Access rollout schedule.

Prerequisites

  • ossutil is installed and configured with a valid endpoint and credentials

  • An active Alibaba Cloud account with the oss:PutBucket permission

Synopsis

ossutil api put-bucket
  --bucket <bucket-name>
  [--acl <value>]
  [--create-bucket-configuration <value>]
  [--resource-group-id <value>]
FlagRequiredDescription
--bucketYesBucket name (3-63 characters, lowercase letters, digits, hyphens)
--aclNoAccess control: private (default), public-read, public-read-write
--create-bucket-configurationNoStorage class and redundancy type (inline JSON, inline XML, or file:// path)
--resource-group-idNoResource group to assign the bucket to

Examples

Create a bucket with default settings

ossutil api put-bucket --bucket examplebucket

On success, the command returns HTTP 200. Verify the bucket exists:

ossutil ls oss://examplebucket

An empty listing with no error confirms the bucket is ready.

Create an Infrequent Access bucket with zone-redundant storage

ossutil api put-bucket --bucket examplebucket \
  --create-bucket-configuration '{"StorageClass":"IA","DataRedundancyType":"ZRS"}'

The bucket is created with IA storage class and zone-redundant storage (ZRS).

Load configuration from a JSON file

  1. Create a file named bucket-config.json:

       {
         "StorageClass": "IA",
         "DataRedundancyType": "ZRS"
       }
  2. Run the command:

       ossutil api put-bucket --bucket examplebucket \
         --create-bucket-configuration file://bucket-config.json

Load configuration from an XML file

  1. Create a file named bucket-config.xml:

       <?xml version="1.0" encoding="UTF-8"?>
       <CreateBucketConfiguration>
         <StorageClass>Archive</StorageClass>
         <DataRedundancyType>LRS</DataRedundancyType>
       </CreateBucketConfiguration>
  2. Run the command:

       ossutil api put-bucket --bucket examplebucket \
         --create-bucket-configuration file://bucket-config.xml

Set the ACL and assign a resource group

ossutil api put-bucket --bucket examplebucket \
  --acl private \
  --resource-group-id rg-123 \
  --create-bucket-configuration '{"StorageClass":"Standard","DataRedundancyType":"LRS"}'

Parameters

--bucket string (required)

The bucket name. Names must meet all of the following rules:

  • 3 to 63 characters long

  • Contains only lowercase letters, digits, and hyphens (-)

  • Starts and ends with a lowercase letter or digit

  • No consecutive hyphens

Bucket names are globally unique across all OSS users. If the name is taken by another account, the command returns BucketAlreadyExists.

--acl string (optional)

The access control list for the bucket. Defaults to private.

ValueDescription
private (default)Only the bucket owner can read and write objects
public-readAnyone can read objects; only the owner can write
public-read-writeAnyone can read and write objects
If Block Public Access is enabled, setting public-read or public-read-write returns an error.

--create-bucket-configuration string (optional)

The storage class and redundancy type. Accepts an inline JSON string, an inline XML string, or a file path prefixed with file://.

FieldTypeValid valuesDefault
StorageClassstringStandard, IA (Infrequent Access), Archive, ColdArchive (Cold Archive), DeepColdArchive (Deep Cold Archive)Standard
DataRedundancyTypestringLRS (locally redundant storage), ZRS (zone-redundant storage)LRS

Inline JSON:

{
  "StorageClass": "Standard",
  "DataRedundancyType": "LRS"
}

Inline XML:

<?xml version="1.0" encoding="UTF-8"?>
<CreateBucketConfiguration>
  <StorageClass>Standard</StorageClass>
  <DataRedundancyType>LRS</DataRedundancyType>
</CreateBucketConfiguration>

From a file:

--create-bucket-configuration file://bucket-config.json
--create-bucket-configuration file://bucket-config.xml

--resource-group-id string (optional)

The resource group to assign the bucket to. If omitted, the bucket is added to the default resource group.

Output

Returns HTTP 200 with an empty response body on success. The bucket is immediately available -- upload objects and configure additional settings without delay.

Limitations

  • Each Alibaba Cloud account can create up to 100 buckets per region.

  • Each region has its own endpoint. For the full list, see Regions and endpoints.

Idempotency

put-bucket is not idempotent. Calling the command with a bucket name that already exists returns one of the following errors:

ScenarioError code
Bucket is owned by your accountBucketAlreadyOwnedByYou
Bucket is owned by a different accountBucketAlreadyExists

Do not retry on either error. Choose a different bucket name instead. In scripts, check the exit code and error message before retrying any operation.

Permissions

An Alibaba Cloud account has full permissions by default. RAM users and RAM roles have no permissions by default. Grant access through a RAM policy or bucket policy.

ActionRequired for
oss:PutBucketCreating the bucket
oss:PutBucketAclSetting --acl during creation, or modifying the ACL after creation

Minimal RAM policy:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "oss:PutBucket",
        "oss:PutBucketAcl"
      ],
      "Resource": "acs:oss:*:*:*"
    }
  ]
}

Replace * in the resource ARN with a specific bucket name (for example, acs:oss:*:*:examplebucket) to restrict access to that bucket.

Common errors

Error codeCauseResolution
BucketAlreadyExistsThe bucket name is taken by a different accountChoose a different bucket name
BucketAlreadyOwnedByYouThe bucket already exists in your accountNo action needed. The bucket is ready to use
InvalidBucketNameThe bucket name violates naming rulesReview the naming rules under the --bucket parameter
TooManyBucketsYour account reached the 100-bucket-per-region limitDelete unused buckets or submit a quota increase request
AccessDeniedThe RAM user or role lacks the required permissionsAttach a RAM policy that grants oss:PutBucket
InvalidArgumentAn unsupported ACL value was specified with Block Public Access enabledDisable Block Public Access or use private ACL

What's next