Deploy Minio on Docker Swarm Slack Go Report Card Docker Pulls codecov

Docker Engine provides cluster management and orchestration features in Swarm mode. Minio server can be easily deployed in distributed mode on Swarm to create a multi-tenant, highly-available and scalable object store.

As of Docker Engine v1.13.0 (Docker Compose v3.0), Docker Swarm and Compose are cross-compatible. This allows a Compose file to be used as a template to deploy services on Swarm. We have used a Docker Compose file to create distributed Minio setup.

1. Prerequisites

2. Create a Swarm

SSH into the machine supposed to serve as Swarm manager. If the machine is named manager, you can SSH by

docker-machine ssh manager

After logging in to the designated manager node, create the Swarm by

docker swarm init --advertise-addr <MANAGER-IP>

After the manager is up, add worker nodes to the Swarm. Find detailed steps to create the Swarm on Docker documentation site.

3. Create Docker secrets for Minio

echo "AKIAIOSFODNN7EXAMPLE" | docker secret create access_key -
echo "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | docker secret create secret_key -

4. Deploy distributed Minio services

Download the Docker Compose file on your Swarm master. Then execute the command

docker stack deploy --compose-file=docker-compose-secrets.yaml minio_stack

This deploys services described in the Compose file as Docker stack minio_stack. Look up the docker stack command reference for more info.

After the stack is successfully deployed, you should be able to access Minio server via Minio Client mc or your browser at http://[Node_Public_IP_Address]:[Expose_Port_on_Host]

4. Remove distributed Minio services

Remove the distributed Minio services and related network by

docker stack rm minio_stack


Explore Further