Skip to main content

Minio

src

Minio is a high performance distributed object storage server, designed for large-scale private cloud infrastructure. Minio is a self-hosted alternative to AWS S3.

We will use it for fun as a way to store files and images for our local cloud services.

But we will also use it for our Grafana instance services to store logs and traces.

Setup

Lets start by creating a new directory for our minio instance.

mkdir -p ~/local-cloud/minio
cd ~/local-cloud/minio

Now we can create a docker-compose.yml file to start our minio instance.

version: '3.8'

networks:
proxy:
external: true

volumes:
buckets:

services:
minio:
container_name: minio
hostname: minio
image: minio/minio:latest
restart: unless-stopped
entrypoint:
- sh
- -euc
- mkdir -p /data/tempo && mkdir -p /data/loki-data && mkdir -p /data/loki-ruler && minio server /data --console-address ':9001'
networks:
- proxy
environment:
- MINIO_ROOT_USER=automation
- MINIO_ROOT_PASSWORD=supersecret
volumes:
- buckets:/data
ports:
- 9001:9001
- 9000:9000
labels:
- "traefik.enable=true"
- "traefik.http.routers.minio.rule=Host(`minio.localhost`) || Host(`minio.dev.localhost`)"
- "traefik.http.routers.minio.entrypoints=web,websecure"
- "traefik.http.routers.minio.tls=true"
- "traefik.http.routers.minio.service=minio@docker"
- "traefik.http.services.minio.loadBalancer.server.port=9001"
- "traefik.http.services.minio.loadBalancer.server.scheme=http"

- "traefik.http.routers.s3.rule=Host(`s3.localhost`) || Host(`s3.dev.localhost`)"
- "traefik.http.routers.s3.entrypoints=web,websecure"
- "traefik.http.routers.s3.tls=true"
- "traefik.http.routers.s3.service=s3@docker"
- "traefik.http.services.s3.loadBalancer.server.port=9000"
- "traefik.http.services.s3.loadBalancer.server.scheme=http"
  • Volumes - We are creating a volume for our minio buckets to persist data.
  • Entrypoint - We are creating directories for our logs and traces and starting minio server on port 9001. These directories will show up as buckets in minio UI.
  • Ports - We are exposing minio on port 9000 and 9001. 9000 is the default port for minio and 9001 is the console port.
  • Labels - We are using traefik to route traffic to minio. We are exposing minio ui on minio.localhost and minio api s3.localhost.

Root User and Pass

We are setting the root user and password for minio to automation and supersecret. You can change this to whatever you like in the variables.

Start Minio

Now we can start our minio instance.

docker compose up -d

You should be able to access Minio UI

Minio Console

Login with root user

src

Then you will get taken to the dashboard and see the buckets we generated at startup.

src

Next Steps

Now that we have Minio setup we can use it to store files and images for our local cloud services.