How to Deploy Minio on Ubuntu Server Using Docker

Learn how to deploy Minio on an Ubuntu server using Docker. This step-by-step guide covers installation, Docker Compose setup, storage configuration, security, and public access settings to efficiently manage object storage with Minio.

Minio on Ubuntu using Docker

βœ… Related Articles:

1. Install Docker and Docker Compose

First, update your Ubuntu system and install Docker.

Step 1: Update System Packages

sudo apt update && sudo apt upgrade -y

Step 2: Install Docker

sudo apt install docker.io -y

Step 3: Install Docker Compose

sudo apt install docker-compose -y

Verify Docker is running:

sudo systemctl enable --now docker
sudo systemctl status docker

2. Deploy Minio with Docker Compose

Step 1: Create a Minio Directory

mkdir -p ~/minio && cd ~/minio

Step 2: Create docker-compose.yml

nano docker-compose.yml

Step 3: Add the following configuration

version: '3.8'

services:
  minio:
    image: minio/minio:latest
    container_name: minio
    restart: always
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ROOT_USER: your-access-key
      MINIO_ROOT_PASSWORD: your-secret-key
    volumes:
      - minio_data:/data
    command: server /data --console-address ":9001"

volumes:
  minio_data:

⚠ Replace your-access-key and your-secret-key with strong credentials.


3. Start Minio Using Docker Compose

Step 1: Run Minio

docker-compose up -d
  • The -d flag runs Minio in the background.

Step 2: Check Running Containers

docker ps

You should see Minio running.

Step 3: View Logs

If Minio doesn't start properly:

docker logs minio

4. Access Minio Web UI

  • Minio Server API: http://your-server-ip:9000
  • Minio Console UI: http://your-server-ip:9001
  • Login Credentials:
  • Username: your-access-key
  • Password: your-secret-key

5. Test Minio Storage

Step 1: Install AWS CLI

sudo apt install awscli -y

Step 2: Configure AWS CLI for Minio

aws configure
  • Access Key ID: your-access-key
  • Secret Access Key: your-secret-key
  • Region: us-east-1
  • Output format: json

Step 3: Create a Minio Bucket

aws --endpoint-url http://your-server-ip:9000 s3 mb s3://my-bucket

Step 4: Upload a File

echo "Hello Minio" > test.txt
aws --endpoint-url http://your-server-ip:9000 s3 cp test.txt s3://my-bucket/

Step 5: List Files

aws --endpoint-url http://your-server-ip:9000 s3 ls s3://my-bucket/

6. Make Minio Publicly Accessible

If you need public file access, update the Minio bucket policy.

Step 1: Open Minio Console UI

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::my-bucket/*"
        }
    ]
}

Step 2: Restart Minio

docker-compose down
docker-compose up -d

7. Secure Minio with Nginx (Optional)

If you want to enable HTTPS, use Nginx as a reverse proxy.

Step 1: Install Nginx

sudo apt install nginx -y

Step 2: Create an Nginx Configuration File

sudo nano /etc/nginx/sites-available/minio

Step 3: Add the following Nginx configuration

server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Step 4: Enable the Configuration

sudo ln -s /etc/nginx/sites-available/minio /etc/nginx/sites-enabled/
sudo systemctl reload nginx

Step 5: Install Let's Encrypt SSL (Optional)

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d your-domain.com

🎯 Final Checklist

βœ… Minio is installed using Docker (docker ps shows it running).

βœ… Minio Web UI is accessible (http://your-server-ip:9001).

βœ… Minio storage works (Tested using AWS CLI).

βœ… Firewall allows Minio ports (9000 & 9001).

βœ… Nginx is configured for HTTPS (Optional).


πŸš€ Now, Minio is fully deployed using Docker on your Ubuntu server!

  • If you have any questions, contact me on Telegram.