Cloud Computing 9 min read

How to Build Your Own MinIO Object Storage Service with Docker and CLI

This guide walks you through installing MinIO with Docker, using its visual Console, managing buckets and files via the MinIO Client, and leveraging S3 compatibility to integrate with third‑party tools, providing a complete self‑hosted object storage solution.

macrozheng
macrozheng
macrozheng
How to Build Your Own MinIO Object Storage Service with Docker and CLI

When developing projects, file storage is a common requirement, often addressed with object storage services such as OSS or AWS S3. This article shows how to set up your own MinIO object storage service with a visual Console.

MinIO Overview

MinIO is a high‑performance object storage service written in Go, open‑source under the Apache License v2.0, and suitable for storing large amounts of unstructured data such as images, videos, logs, backups, and container images.

Installation

Install MinIO using Docker: docker pull minio/minio Run the container, specifying the console address with --console-address:

docker run -p 9090:9000 -p 9091:9001 --name minio \
  -v /mydata/minio/data:/data \
  -e MINIO_ROOT_USER=minioadmin \
  -e MINIO_ROOT_PASSWORD=minioadmin \
  -d minio/minio server /data --console-address ":9001"

After the container starts, access the MinIO Console at http://<your‑host>:9090 and log in with minioadmin:minioadmin.

Using MinIO Console

The Console provides a richer UI than the older MinIO Browser, supporting bucket and file management, user and permission administration, and logs.

Create a bucket.

Upload a file to the bucket.

Set the bucket policy to public if external access is needed.

Access the file via the external URL (e.g., http://<your‑host>:9090/blog/avatar.png).

MinIO Client (mc) Usage

MinIO also provides a command‑line client called mc. Install it via Docker:

docker pull minio/mc
docker run -it --entrypoint=/bin/sh minio/mc

Configure the client to point to your MinIO server:

mc config host add minio http://<your‑host>:9090 minioadmin minioadmin

Common Commands

ls

– List buckets or objects. mb – Create a bucket. rb – Remove a bucket. cp – Copy files or objects. share download – Generate a download URL. find – Search for objects with patterns. policy set – Set bucket access policy (none, download, upload, public).

Examples:

# List buckets
mc ls minio
# List objects in a bucket
mc ls minio/blog
# Create a bucket named test
mc mb minio/test
# Share a file
mc share download minio/blog/avatar.png
# Find PNG files in a bucket
mc find minio/blog --name "*.png"
# Set a bucket to read‑only
mc policy set download minio/test/

AWS S3 Compatibility

MinIO implements most AWS S3 APIs, allowing you to use third‑party S3 tools such as S3 Browser. After adding an account with type “S3 Compatible Storage”, you can see the buckets and objects created in MinIO.

When a PNG file is served, MinIO may return application/octet-stream as the Content‑Type, preventing direct image preview. Using S3 Browser, you can modify the response header for .png files to image/png, then re‑upload the files to apply the change.

Summary

If you need a self‑hosted object storage service, MinIO is a solid choice. It is compatible with AWS S3 APIs, enabling integration with many third‑party tools. While the built‑in Console is limited, the powerful mc client and S3‑compatible tools provide full functionality.

CLIDockerMinIOObject StorageS3 Compatibility
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.