Deploy MinIO Object Storage with Docker and Master mc Client Commands
MinIO is an open-source object storage service licensed under Apache License v2.0. It is compatible with Amazon S3 cloud storage interfaces and is ideal for storing large volumes of unstructured data, such as images, videos, log files, backup data, and container/VM images. This article shares how to deploy a single-disk MinIO object storage service using Docker.

Deploy MinIO Server with Docker
Before starting, ensure you have Docker installed. For reference, see Linux Docker Installation and Common Commands. Then execute the following command:
docker run -d -p 9000:9000 \
-p 9001:9001 \
--name minio \
-v /data/minio:/data \
-e "MINIO_ROOT_USER=xxx" \
-e "MINIO_ROOT_PASSWORD=xxx" \
-e MINIO_DOMAIN="xxx.com" \
--restart=always \
minio/minio server /data --console-address ":9001"
Parameter Explanations:
9000: Data communication port, used when uploading objects via client or API./data/minio: Local mount path.MINIO_ROOT_USER: Sets the username.MINIO_ROOT_PASSWORD: Sets the password.MINIO_DOMAIN: Sets the domain name (explained further below).--console-address ":9001": Web access port. This parameter was added in recent versions; older versions did not include it.
Purpose of Domain Name:
By default, to access an object, the address is: http://IP:9001/bucket/xxx.txt. If you add the MINIO_DOMAIN parameter during setup and resolve the domain, you can access objects using: http://bucket.xxx.com/1.txt. This effectively maps the bucket name to the domain prefix.
Access and Configuration
After deployment, access via your IP:9001 (or domain if resolved) and log in with the username and password set above.

Users familiar with object storage know the concept of a "bucket" (translated from Chinese as "桶"). Objects (files) are stored inside these buckets. Click "Create Bucket" to create one.

Choose any name for the bucket as long as it is unique. You can also choose whether to enable object versioning and set data limits (e.g., capacity or file count). However, since this is a single-disk deployment, some features may not be supported.

Install mc Client
The mc client is used to operate and manage MinIO. For Linux systems:
# Download mc client
wget https://dl.min.io/client/mc/release/linux-amd64/mc
# Add execute permission
chmod +x mc
# Move to /usr/bin directory
mv mc /usr/bin/
# View help
./mc --help
Before use, configure the storage by executing:
mc config host add minio http://192.168.1.51 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 --api s3v4
http://192.168.1.51: MinIO server IP (include port number if using Docker, e.g.,:9000).BKIKJAA5BMMU2RHO6IBB: Corresponds to the username (AccessKeyID).V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12: Corresponds to the password (SecretAccessKey).
This adds the configuration to /root/.mc/config.json. To remove a storage, edit the JSON file or use:
# Remove storage named 'minio'
mc config host remove minio
Common Commands:
ls List files and folders.
mb Create a bucket or folder.
cat Display file and object content.
pipe Redirect STDIN to an object, file, or STDOUT.
share Generate URLs for sharing.
cp Copy files and objects.
mirror Mirror buckets and folders.
find Find files based on parameters.
diff Compare differences between folders or buckets.
rm Delete files and objects.
events Manage object notifications.
watch Listen for file and object events.
policy Manage access policies.
session Manage saved sessions for cp commands.
config Manage mc configuration files.
update Check for software updates.
version Output version information.
mc Command Examples
# List added hosts
mc config host list
# List files in a specific bucket
mc ls host/bucket/
# Copy a local file to a target host
mc cp local_file host/bucket/
# Copy a file from MinIO to local
mc cp host/bucket/file_name ./
# Set MinIO anonymous access policy (options: none, download, upload, public)
mc policy set upload host/bucket/
# View anonymous policies
mc policy list host/bucket/
host: The name set inmc config host add.bucket: The name of the storage bucket.
Note: It is generally not recommended to set anonymous access policies to public, as this allows anyone to upload, download, or delete files, which is highly dangerous. For public file access, setting the policy to download is usually sufficient.
Further Operations
For more advanced setups, refer to my other article: Using Nginx Reverse Proxy for MinIO to Provide Public File Access.
Conclusion
This article briefly introduces MinIO server installation and basic mc client usage. MinIO offers many more features and capabilities. This guide demonstrates a quick single-disk setup; for production use, a multi-disk distributed solution is recommended. As a mature and well-established enterprise-grade self-hosted object storage solution, MinIO is worth considering for organizations with object storage needs.
- MinIO Official Website: https://min.io/
- MinIO Chinese Documentation: http://docs.minio.org.cn/docs/