Tools
Deploying Minio using Docker Compose
2025-12-29
0 views
admin
Defining network ## Defining volume ## Defining service ## Final docker compose ## NodeJS Essentials | Free E-Book ## Adnan Babakan (he/him) ・ Sep 11 '20 Hey there DEV.to community! As you might have heard about Minio, it is a free S3 storage server that you can set up and use locally or along your project to leverage the full potential of a powerful storage software and store your files inside with blazing fast response time. Here is how to set it up using a Docker Compose file. First of all, if you don't have it yet, create a file named docker-compose.yml. First of all we have to define a network so we can connect our server to it and share it between other services if we tend to do such a thing. A bridge network allows your containers communicate with each other if they are on the same network while being isolated from other networks. And only publicly accessible if ports are published. By defining a volume, we can keep our data persistent. Here is how to define one: Now it comes to Minio itself. By defining a service using the appropriate image from the docker registry we may start our service: I've named my service minio which will create a container named after it. You may define another name for your service or define another container name using container_name attribute. The minio/minio image is the official image to deploy minio so there won't be a change here. Using environment variables we define the root username and password. Make sure your password is at elast 8 characters long as it is required by minio. Attach the service to your created network using the networks attribute of the service. Minio stores data at /data so map it to the volume we created before using volumes attribute. Minio exposes two ports being 9000 for api and 9001 for web ui so expose them to public network using ports attribute. And finally start the service using the command added above and DONE! Here is the final docker compose: I hope this comes in handy and useful to you. BTW! Check out my free Node.js Essentials E-book here: Feel free to contact me if you have any questions, projects or suggestions to improve this article. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse CODE_BLOCK:
networks: minio-network: driver: bridge Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
networks: minio-network: driver: bridge CODE_BLOCK:
networks: minio-network: driver: bridge CODE_BLOCK:
volumes: minio-volume: driver: local Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
volumes: minio-volume: driver: local CODE_BLOCK:
volumes: minio-volume: driver: local CODE_BLOCK:
services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ] Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ] CODE_BLOCK:
services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ] CODE_BLOCK:
networks: minio-network: driver: bridge volumes: minio-volume: driver: local services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ] Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
networks: minio-network: driver: bridge volumes: minio-volume: driver: local services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ] CODE_BLOCK:
networks: minio-network: driver: bridge volumes: minio-volume: driver: local services: minio: image: minio/minio environment: - MINIO_ROOT_USER=root - MINIO_ROOT_PASSWORD=rootpass123 - MINIO_DEFAULT_BUCKETS=bucket networks: - minio-network volumes: - minio-volume:/data ports: - "9222:9000" - "9223:9001" command: [ "server", "--console-address", ":9001", "/data" ]
how-totutorialguidedev.toaimlservernetworkdockernode