Skip to content

Instantly share code, notes, and snippets.

@sohelrana820
Forked from a-h-abid/example.lifecycle.json
Last active July 7, 2022 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sohelrana820/c1e2a4c8ea747f9c23be62249d294a96 to your computer and use it in GitHub Desktop.
Save sohelrana820/c1e2a4c8ea747f9c23be62249d294a96 to your computer and use it in GitHub Desktop.
MinIO MC Commands Quick Sheet

MinIO Commands

## Alias to Minio Server
mc alias set myminio http://localhost:9000 <access-key> <secret-key>

## List Directories (Root Buckets + Directories)
mc ls myminio
mc ls myminio bucket/folder

## List Policies
mc admin policy list myminio

## Add Policy
mc admin policy add myminio app-all /path/to/policy.json

## List Users
mc admin user list myminio

## Add User
mc admin user add myminio newuser newuser123

## Assign User to Policy
mc admin policy set myminio app-all user=newuser

## Disable User
mc admin user disable myminio newuser

## Remove User
mc user remove myminio newuser

## Set Bucket Lifecycle
mc ilm import myminio/bucket-name < ./path/to/lifecycle.json

## List Bucket Lifecycles
mc ilm ls myminio/bucket-name

## Get Policy of Bucket / Folder
mc policy get myminio/bucket-name/folder

## Set Policy for Bucket / Folder
mc policy set <none/download/upload/public> myminio/bucket-name/folder


Set Minio Bucket Policy
docker-compose run --rm minio-client alias set myminio http://minio:9000 access-key secret-key
docker-compose run --rm minio-client policy set public myminio/bucket_name


Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment