Skip to main content

Create new buckets

还没翻译译自英文(developers.cloudflare.com)本页 16 段都还没译

You can create a bucket from the Cloudflare dashboard or using Wrangler.

Note

Wrangler is a command-line tool for building with Cloudflare's developer products, including R2.

The R2 support in Wrangler allows you to manage buckets and perform basic operations against objects in your buckets. For more advanced use-cases, including bulk uploads or mirroring files from legacy object storage providers, we recommend rclone or an S3-compatible tool of your choice.

Bucket-Level Operations

Create a bucket with the r2 bucket create command:

wrangler r2 bucket create your-bucket-name

Note

  • Bucket names can only contain lowercase letters (a-z), numbers (0-9), and hyphens (-).
  • Bucket names cannot begin or end with a hyphen.
  • Bucket names can only be between 3-63 characters in length.

The placeholder text is only for the example.

List buckets in the current account with the r2 bucket list command:

wrangler r2 bucket list

To delete a bucket, you must first empty it and then delete it. For detailed instructions, refer to Delete buckets.

Notes

  • Bucket names and buckets are not public by default. To allow public access to a bucket, refer to Public buckets.
  • For information on controlling access to your R2 bucket with Cloudflare Access, refer to Protect an R2 Bucket with Cloudflare Access.
  • Invalid (unauthorized) access attempts to private buckets do not incur R2 operations charges against that bucket. Refer to the R2 pricing FAQ to understand what operations are billed vs. not billed.