Create and manage buckets in Object Storage
Last updated on
Buckets are the top-level containers for storing objects in Object Storage. Each object lives inside a bucket, and all data access is scoped to a bucket and its credentials.
Prerequisites
Section titled “Prerequisites”- Object Storage enabled in your project: Enable Object Storage
- Object Storage credentials: Manage credentials
- AWS CLI or s5cmd configured with your credentials for CLI operations: Set up the AWS CLI
Create a bucket
Section titled “Create a bucket”Bucket names must be DNS-conformant: 3–63 characters, lowercase letters, numbers, and hyphens only. The name must be unique within the region.
- In the STACKIT Portal, open your project.
- In the sidebar, select Object Storage - Buckets.
- Select Create Bucket.
- Enter a name for your bucket.
- Select Order with costs to confirm.
Your bucket appears in the bucket list.
aws s3 mb s3://my-bucket \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output confirms the creation:
make_bucket: my-buckets5cmd --endpoint-url https://object.storage.eu01.onstackit.cloud \ mb s3://my-bucketThe output confirms the creation:
mb s3://my-bucketList buckets
Section titled “List buckets”In the STACKIT Portal, open your project and select Object Storage - Buckets in the sidebar. The page shows all buckets in your project along with their size, object count, and creation date.
aws s3 ls \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output lists all buckets with their creation date:
2024-01-01 10:00:00 my-bucket2024-01-02 12:30:00 another-buckets5cmd --endpoint-url https://object.storage.eu01.onstackit.cloud lsThe output lists all buckets:
2024/01/01 10:00:00 s3://my-bucket2024/01/02 12:30:00 s3://another-bucketDelete a bucket
Section titled “Delete a bucket”- In the STACKIT Portal, open your project.
- In the sidebar, select Object Storage - Buckets.
- At the end of the row for the bucket you want to delete, select the three-dot menu (⋮), then select Delete.
- Enter the bucket name to confirm the deletion, then select Delete.
The bucket is removed from the list.
The rb command only deletes empty buckets. Use --force to delete a bucket and all its objects:
aws s3 rb s3://my-bucket --force \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output confirms the deletion:
delete: s3://my-bucket/example.txtremove_bucket: my-buckets5cmd requires the bucket to be empty before deleting it. Remove all objects first, then delete the bucket:
s5cmd --endpoint-url https://object.storage.eu01.onstackit.cloud \ rm "s3://my-bucket/*"
s5cmd --endpoint-url https://object.storage.eu01.onstackit.cloud \ rb s3://my-bucketThe output confirms the deletion:
rb s3://my-bucket