StorageStorage ServicesMinio

Minio

Last updated:

MinIO

Overview

MinIO is a high-performance, S3-compatible object storage service. It can be self-hosted or used as a managed service, providing S3-compatible APIs.

Installation

npm install @aws-sdk/client-s3 @aws-sdk/credential-providers @aws-sdk/s3-request-presigner @aws-sdk/signature-v4-crt aws-crt @aws-sdk/types

Usage

MinIO is S3-compatible, so use the S3Storage with MinIO endpoint:

import { S3Storage } from "@visulima/storage/provider/aws";
import { minio } from "@visulima/storage/provider/aws/s3/clients";

const storage = new S3Storage({
    bucket: "my-bucket",
    region: "us-east-1",
    endpoint: "http://localhost:9000", // MinIO endpoint
    credentials: {
        accessKeyId: process.env.MINIO_ACCESS_KEY!,
        secretAccessKey: process.env.MINIO_SECRET_KEY!,
    },
    forcePathStyle: true, // Required for MinIO
});

Configuration

Using Client Helper

import { minio } from "@visulima/storage/provider/aws/s3/clients";

const clientConfig = minio({
    accessKeyId: process.env.MINIO_ACCESS_KEY!,
    secretAccessKey: process.env.MINIO_SECRET_KEY!,
    endpoint: "http://localhost:9000",
    region: "us-east-1",
});

const storage = new S3Storage({
    bucket: "my-bucket",
    ...clientConfig,
});

Self-Hosted MinIO

const storage = new S3Storage({
    bucket: "my-bucket",
    endpoint: "http://minio.example.com:9000",
    region: "us-east-1",
    credentials: {
        accessKeyId: "minioadmin",
        secretAccessKey: "minioadmin",
    },
    forcePathStyle: true, // Required for self-hosted MinIO
});

Managed MinIO (MinIO Object Storage)

const storage = new S3Storage({
    bucket: "my-bucket",
    endpoint: "https://s3.your-minio-instance.com",
    region: "us-east-1",
    credentials: {
        accessKeyId: process.env.MINIO_ACCESS_KEY!,
        secretAccessKey: process.env.MINIO_SECRET_KEY!,
    },
});

Features

  • S3-Compatible: Full S3 API compatibility
  • Self-Hosted: Deploy on your own infrastructure
  • High Performance: Optimized for performance
  • Distributed: Support for distributed deployments

Best Practices

  1. Use forcePathStyle - Required for self-hosted MinIO
  2. Configure TLS - Use HTTPS for production
  3. Set up access policies - Configure bucket policies
  4. Monitor performance - Track MinIO metrics
  5. Backup regularly - Implement backup strategy for self-hosted deployments
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues