Create your first Object Storage bucket and upload an object
Last updated on
Prerequisites
Section titled “Prerequisites”- A STACKIT customer account: Create a customer account
- A STACKIT project: Create a project
- AWS CLI installed: Set up the AWS CLI
Enable Object Storage
Section titled “Enable Object Storage”- In the STACKIT Portal, open your project.
- In the sidebar, select Object Storage - Overview.
- Select Enable Object Storage.
Object Storage is now enabled in your project. You can start creating buckets and managing credentials.
Create credentials
Section titled “Create credentials”- In the STACKIT Portal, open your project.
- In the sidebar, select Object Storage - Credentials & Groups.
- Select an existing credential group to open its General information view.
- In the navigation bar on the right, select the Credentials tab.
- Select Create credentials.
- A dialog opens showing your new Access key ID and Secret access key.
- Save both values now.
Your credentials appear in the credentials list.
Installation
Section titled “Installation”Download the latest release for your platform from the GitHub repository.
Unpack the downloaded archive and move the runnable file to /usr/local/bin:
mv s5cmd /usr/local/bin/For Debian-based distributions, install the .deb package directly with dpkg:
dpkg -i s5cmd_2.3.0_linux_amd64.debInstall with Homebrew:
brew install peak/tap/s5cmdUnpack the downloaded archive and place the .exe file in a directory that is in your system path.
Configuration
Section titled “Configuration”Set the required environment variables so s5cmd can connect to your STACKIT Object Storage endpoint.
export S3_ENDPOINT_URL="https://object.storage.eu01.onstackit.cloud"export AWS_ACCESS_KEY_ID="xxxxxxxxxxxx" export AWS_SECRET_ACCESS_KEY="yyyyyyyyyyyyyyyyyyyyyy"export AWS_REGION="eu01"setx S3_ENDPOINT_URL "https://object.storage.eu01.onstackit.cloud"setx AWS_ACCESS_KEY_ID "xxxxxxxxxxxx"setx AWS_SECRET_ACCESS_KEY "yyyyyyyyyyyyyyyyyyyyyy"setx AWS_REGION "eu01"Create a bucket
Section titled “Create a bucket”aws s3 mb s3://my-first-bucket \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output confirms the creation:
make_bucket: my-first-bucketUpload your first object
Section titled “Upload your first object”Create a small test file and upload it to your bucket. Replace my-first-bucket with your actual bucket name:
echo "Hello Object Storage" > hello.txtaws s3 cp hello.txt s3://my-first-bucket/ \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output confirms the upload:
upload: ./hello.txt to s3://my-first-bucket/hello.txtVerify the upload
Section titled “Verify the upload”List the contents of your bucket to confirm the object was stored:
aws s3 ls s3://my-first-bucket/ \ --endpoint-url https://object.storage.eu01.onstackit.cloudThe output shows your uploaded file:
2024-01-01 10:00:00 21 hello.txtYour Object Storage bucket is now set up and contains your first object. Continue with the How-tos to manage all features in detail.