docs/examples/compose/minio/README.md
[!CAUTION] We provide those instructions as an example, it should not be run in production. For production environments, deploy MinIO in a Multi-Node Multi-Drive (Distributed) topology
mkdir minio
curl -o minio/compose.yaml https://raw.githubusercontent.com/suitenumerique/docs/refs/heads/main/docs/examples/compose/minio/compose.yaml
version: '3'
services:
minio:
...
environment:
- MINIO_ROOT_USER=<Set minio root username>
- MINIO_ROOT_PASSWORD=<Set minio root password>
You may not need to expose your MinIO instance to the public if only services hosted on the same private network need to access to your MinIO instance.
You should create a docker network that will be shared between those services
docker network create storage-tier
If you want to expose your MinIO instance to the public, it needs to be exposed on a domain with SSL termination. You can use our example with an nginx proxy and Let's Encrypt companion for automated creation/renewal of Let's Encrypt certificates using acme.sh.
If following our example, uncomment the environment and network sections in compose file and update it with your values.
version: '3'
services:
docs:
...
minio:
...
environment:
...
# - VIRTUAL_HOST=storage.yourdomain.tld # used by nginx proxy
# - VIRTUAL_PORT=9000 # used by nginx proxy
# - LETSENCRYPT_HOST=storage.yourdomain.tld # used by lets encrypt to generate TLS certificate
...
# Uncomment if using our nginx proxy example
# networks:
# - proxy-tier
# - default
# Uncomment if using our nginx proxy example
#networks:
# proxy-tier:
# external: true
In this example we are only exposing MinIO API service. Follow the official documentation to configure Minio WebUI.
`docker compose up -d`
Your minio instance is now available on https://storage.yourdomain.tld
Follow the official documentation to install mc
mc to connect to your MinIO Server with your root usermc alias set minio <MINIO_SERVER_URL> <MINIO_ROOT_USER> <MINIO_ROOT_PASSWORD>
Replace the values with those you have set in the previous steps
mc mb --with-versioning minio/<your-bucket-name>
Replace your-bucket-name with the desired name for your bucket e.g. docs-media-storage
For increased security you should create a dedicated user with readwrite access to the Bucket. In the following example we will use MinIO root user.