Welcome to the upcoming version of the MinIO Documentation! The content on this page is under active development and may change at any time. If you can't find what you're looking for, check our legacy documentation. Thank you for your patience.

mc mb

Description

The mc mb command creates a new bucket or directory at the specified path. For targets on an S3-compatible service, mc mb creates a new bucket. For targets on a filesystem, mc mb has equivalent functionality to mkdir -p.

Bucket Limits for Non-MinIO S3 Services

Certain S3 services may restrict the number of buckets a given user or account can create. For example, Amazon S3 limits each account to 100 buckets. mc mb may return an error if the user has reached bucket limits on the target S3 service.

MinIO Object Storage deployments do not place any limits on the number of buckets each user can create.

Examples

Create Bucket

Use mc mb to create a bucket on an S3-compatible host. The --with-lock option creates the bucket with locking enabled:

mc mb --with-lock ALIAS/BUCKET
  • Replace ALIAS with the alias of the S3-compatible host.

  • Replace BUCKET with the bucket to create.

Syntax

mb has the following syntax:

mc mb [FLAGS] TARGET [TARGET...]

mb supports the following arguments:

TARGET

Required The full path to the bucket or directory to create. If creating a directory on a filesystem, mc mb creates all required folders in the specified path similar to mkdir -p.

To create a bucket, specify the alias of a configured S3 service as the prefix to the TARGET path. For example:

mc mb [FLAGS] play/mybucket
--region

The region in which to create the specified bucket. Has no effect if the specified TARGET is a filesystem directory.

--ignore-existing, --p

Directs mc mb to do nothing if the bucket or directory already exists.

--with-lock, --l

Enables object locking on the specified bucket. Has no effect if the specified TARGET is a filesystem directory.

Important

You can only enable object locking when creating the bucket. You cannot use features like Bucket Lifecycle Management, Bucket Object Retention, or Bucket Legal Hold if object locking is disabled for a bucket.