Docker-Compose single-host Minio S3 setup using Traefik (Let's Encrypt with DNS-01 challenge via Cloudflare) for TLS offloading.
Tested on Ubuntu 20.04.
Run all commands shown here with root
or prepend a sudo
to the regarding commands which require higher privileges.
apt-get update
apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
systemctl enable --now docker
# Verification:
systemctl status docker
docker info
Sources:
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Verification:
docker-compose --version
Sources:
mkdir -p /root/minio
cd /root/minio
mkdir -p ./traefik/letsencrypt
# Rename "1-minio-env.env" to ".env" and "2-minio-docker-compose.yaml" to "docker-compose.yaml" and copy them to this directory
chmod 600 .env
docker-compose up -d
Sometimes the Minio CLI is required to manage Minio buckets, policies or users:
wget https://dl.min.io/client/mc/release/linux-amd64/mc
mv mc /usr/local/bin/
chmod +x /usr/local/bin/mc
mc --help
# Configure the local Minio instance:
mc alias set myminio https://minio.example.com <MINIO_ROOT_USER> <MINIO_ROOT_PASSWORD>
# Test the access by listing all buckets:
mc ls myminio
# Create bucket
mc mb myminio/my-bucket
# Add an user
mc admin user add myminio my-user <super-secret-40-char-password-here>
# Create the "rw-my-minio-bucket-policy" policy and assign it to the user so the user only has access to the "my-bucket" bucket:
mc admin policy add myminio rw-my-minio-bucket-policy minio-bucket-policy.json
mc admin policy set myminio rw-my-minio-bucket-policy user=my-user