1

I want to create a bucket in Minio via curl, but this fails

curl -X PUT -u "minioroot:miniopassword" "http://localhost:9000/ci-bucket"

The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

I have Minio running in a kind cluster.

How to create a bucket via curl?

I would like to avoid installing the mc command.

guettli
  • 3,811

1 Answers1

1

You need to do what the error message tells you. You can't use basic authentication; you need to use the authentication mechanism required by the S3 API.

That mechanism is described in the document "Authenticating Requests (AWS Signature Version 4)" and the documents linked from there. You need to construct data to sign by canonicalizing the resource and headers and then calculating a HMAC over the data, which then becomes part of the Authorization header. This article has a walk-through of the process using curl.

It is far, far easier to use a tool designed for the purpose. If you don't want to install the minio client, you can also use any other S3-compatible tool (including the official aws cli). I find that the minio client is one of the nicest tools to use for interacting with S3-compatible storage.

larsks
  • 47,453