Skip to content

Service: MinIO

Jonas Birmé edited this page Jan 10, 2025 · 18 revisions

Getting started

The open source project MinIO offers an S3 compatible storage service. This tutorial walks you through using MinIO in Open Source Cloud as a service for managing buckets that can be accessed with AWS S3 compatible clients.

Prerequisites

  • If you have not already done so, sign up for an OSC account.
  • AWS CLI or S3 compatible client

Step 1: Create a MinIO server instance

Click on the button "Create objstorage" and a dialog will be shown.

Skärmavbild 2025-01-10 kl  10 57 28
  • Name: The name of the server instance
  • RootUser: The admin user name
  • RootPassword: The admin password

Wait for the server instance to be created. Once created a new card will be shown that contains the URL to the server.

Skärmavbild 2025-01-10 kl  09 42 17

For example https://demo-guide.minio-minio.auto.prod.osaas.io

This URL is the S3 endpoint that you will use. Now you are ready to create a storage bucket on this server.

Step 2: Create a bucket

We will now create a storage bucket in the storage service we created in step 1. First we will download and install the MinIO client using Homebrew.

% brew install minio/stable/mc

Create an alias for the storage service you created where <tenant> is the id of your tenant. Provide the admin username and password that you used when created the server instance.

% mc alias set guide https://<tenant>-guide.minio-minio.auto.prod.osaas.io root abC12345678
Added `guide` successfully.

Now we can create a bucket that we call tutorial

% mc mb guide/tutorial

Step 3: Access bucket using AWS S3 client

To upload an image we have on local disk to the bucket we will the AWS command line tool as the storage service provides an S3 compatible interface.

% export AWS_ACCESS_KEY_ID=root
% export AWS_SECRET_ACCESS_KEY=abC12345678
% aws --endpoint-url https://<tenant>-guide.minio-minio.auto.prod.osaas.io \
  s3 cp images.jpeg s3://tutorial/
upload: ./images.jpeg to s3://tutorial/images.jpeg

And when we list the content on this bucket we should find the file we just uploaded.

% aws --endpoint-url https://<tenant>-guide.minio-minio.auto.prod.osaas.io s3 ls s3://tutorial/

Be aware that removing a storage service means that the data will be lost.

HTTPS access to bucket

To access an object in a bucket you can use the AWS CLI command presign to generate an HTTP url.

% aws --endpoint-url=https://demo-guide.minio-minio.auto.prod.osaas.io \
  s3 presign s3://tutorial/images.jpeg

See the AWS CLI documentation on how to set the expiration time for the link.

Clone this wiki locally