Quickstart: Create a bucket and upload an object
Create a private bucket in the console, upload a file into it, download the file again, and delete the bucket when you're done.
In this quickstart, you create a private bucket, upload a file into it, download the file, and delete the bucket again. The quickstart has 14 steps in four parts.
Before you begin
- You need the Owner or Contributor role, or a custom role with Manage access to Block & Object Storage, on the subscription or on the project. Any role with Read access to Block & Object Storage lets you view buckets and download objects.
- The project's region must offer Object Storage.
- You need a file on your computer to upload.
Create a bucket
In the console, go to StorageObject Storage.
Select Create bucket.
In Bucket name, enter a name such as acme-reports.
Under Access, keep Visibility set to Private.
Leave the other settings as they are, and select Create bucket at the bottom of the form.
The console returns to the bucket list, where the new bucket appears. The bucket is created in the project's region.
Bucket settings
| Setting | Rules |
|---|---|
| Bucket name | 3 to 63 characters: lowercase letters, digits, dots, and hyphens, starting and ending with a letter or a digit. Unique among the buckets of your tenant, in every project. |
| Visibility | Private by default. Public (anonymous read) lets anyone read every object and list the bucket's contents, without credentials. You can change it later. See Bucket visibility and access. |
| Storage class | Saved with the bucket and shown under its name in the list. It doesn't change how the bucket's objects are stored or billed. |
| Keep previous versions of objects | Off by default. In the console and through the REST API, you can turn it on only when you create the bucket, and you can't turn it off later. The console and the REST API don't list or restore earlier versions of objects. |
The bucket's Overview tab shows these settings, including Versioning.
Upload a file
In the bucket list, select the bucket's name.
Select the Objects tab.
Select Upload, and choose the file. You can also drag the file onto the tab.
Wait until the file shows Uploaded under Uploads.
The file is uploaded directly from your browser to the object store, and its key is the file name. If the upload is refused because the bucket is still being created, wait a moment and upload the file again.
Verify
Check that the file appears in the object list, with its type, size, and modification time.
On the file's row, select Download. Your browser downloads the file directly from the object store.
Clean up resources
Deleting the bucket deletes every object in it. Billing for the bucket's stored data ends when the delete completes.
Go to StorageObject Storage.
On the bucket's row, open the Row actions menu, and select Delete.
Type the bucket's name to confirm, and select Delete.
For more about deleting objects and buckets, see Delete a bucket.
Next steps
Upload, download, and delete objects
Folders, multi-file uploads, the listing, and bulk deletes.
Bucket visibility and access
Make a bucket public, and how signed links work.
Configure CORS rules
Let web applications on other origins use a bucket.
Object Storage FAQ
Answers about billing, versioning, and the APIs.