Overview
This document outlines the steps required to connect Label Studio to MinIO running locally. It covers setting up MinIO, configuring IAM policies, creating a bucket, and integrating Label Studio for data storage and retrieval.
Prerequisites
-
Docker installed on your local machine
-
Label Studio installed locally (Docker or direct installation)
-
MinIO installed and running locally
-
Access to MinIO Console (via browser or command-line)
Step 1: Deploy MinIO Locally
-
Run the following command to start MinIO in a Docker container:
docker run -p 9000:9000 -p 9001:9001 \ -e "MINIO_ROOT_USER=minioadmin" \ -e "MINIO_ROOT_PASSWORD=minioadmin" \ -v ~/minio-data:/data \ --name minio-server \ quay.io/minio/minio server /data --console-address ":9001" -
Access the MinIO Web UI at:
http://127.0.0.1:9001 -
Log in with:
-
Username:
minioadmin -
Password:
minioadmin
-
Step 2: Create a Bucket in MinIO
-
Open the MinIO Console (
http://127.0.0.1:9001). -
Navigate to Buckets and click Create Bucket.
-
Name the bucket (e.g.,
label-studio-bucket). -
Set appropriate permissions (public/private as needed).
-
Click Create.
Alternatively, using MinIO Client (mc):
mc alias set local http://127.0.0.1:9000 minioadmin minioadmin
mc mb local/label-studio-bucket
Step 3: Configure IAM Policy for MinIO
MinIO requires an access policy to allow Label Studio to read/write data. Use the following policy to enable access:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::label-studio-bucket",
"arn:aws:s3:::label-studio-bucket/*"
]
}
]
}
-
Save the above policy in
policy.json. -
Apply it to the bucket:
mc alias set local http://127.0.0.1:9000 minioadmin minioadmin mc admin policy add local label-studio-policy policy.json mc admin user add local label-studio-user password123 mc admin policy set local label-studio-policy user=label-studio-user -
Use the generated Access Key and Secret Key for Label Studio.
Step 4: Connect Label Studio to MinIO
-
Open Label Studio (
http://localhost:8080). -
Navigate to Settings > Cloud Storage.
-
Select Amazon S3 (since MinIO is S3-compatible).
-
Enter the following details:
-
S3 Bucket:
label-studio-bucket -
AWS Access Key ID:
label-studio-user -
AWS Secret Access Key:
password123 -
S3 Region Name:
us-east-1(or any default value) -
S3 Endpoint:
http://127.0.0.1:9000 -
Use Blob URLs:
Checked -
Presign URLs:
Checked(optional, if using presigned URLs)
-
-
Click Test Connection and Save.
-
Click Sync Storage to fetch data from MinIO.
Step 5: Verify Data Sync & Access
Run the following command to list objects in MinIO:
mc ls local/label-studio-bucket
Check if Label Studio correctly displays the images.
If using presigned URLs, ensure the URLs resolve to the correct HTTP format (e.g., http://127.0.0.1:9000/label-studio-bucket/testimage.png).
AWS S3 vs. Azure Blob vs. MinIO: Key Differences
| Feature | AWS S3 | Azure Blob | MinIO (Self-Hosted) |
|---|---|---|---|
| Managed Service | ✅ | ✅ | ❌ (Self-Hosted) |
| Supports Presigned URLs | ✅ | ✅ | ✅ (Manual Configuration) |
| Uses HTTP URLs for Presigned Access | ✅ | ✅ | ❌ (Defaults to S3 format) |
| Requires Local Setup | ❌ | ❌ | ✅ |
| S3-Compatible API | ✅ | ❌ | ✅ |
| Supports On-Prem Storage | ❌ | ❌ | ✅ |
Conclusion
-
MinIO requires additional configuration to work with Label Studio’s presigned URL mechanism.
-
Unlike AWS S3, MinIO does not automatically convert
s3://paths to HTTP URLs. -
To enable presigned URLs, Label Studio must be configured to generate HTTP-based URLs, or MinIO should be accessed directly via its HTTP endpoint.
By following these steps, you can successfully integrate MinIO with Label Studio for local object storage and manage data efficiently.