How to Use mc CLI for Bucket Management and Credential Setup


MinIO mc client 

The MinIO Client, commonly known as mc, is a command-line tool used to interact with MinIO, a high-performance object storage system. The mc client allows users to manage buckets and objects on the MinIO storage service.

  1. Install the mc client on a Linux/Windows machine from the link below:
    https://min.io/docs/minio/linux/index.html
  2. Run the following commands to configure MinIO.
    Connect to MinIO: mc alias set storage-prod http://<private ip>:9000 <minio_root_user> <minio_root_password>

    Note: Replace <private ip> with the IP address of the server where MinIO is hosted. Use <minio_root_user> and <minio_root_password> for the MinIO root user credentials that were set during the initial configuration.
    On Windows machines, ensure you run the above command from the directory where the mc client is located.

    Create access and secret keys: mc admin accesskey create storage-prod/ --access-key <random_chars> --secret-key <random_chars>

    Note: The access key must be between 8 and 20 characters, and the secret key should be between 8 and 40 characters. Both keys should be composed of random characters to maintain strong security

    Set MinIO region: mc admin config set storage-prod region name=<region_name>
    Restart MinIO: mc admin service restart storage-prod

    Note: The <region name>, such as us-west-2 or anything-1, is purely a configuration value. It doesn’t determine the actual physical location where data is stored. Click here to view the list of supported MinIO regions.

    Create buckets: mc mb storage-prod/<bucket_name>

    Note: Create three separate buckets with appropriate names to store Jobs, App Icons, and Reports. Ex:  mc mb storage-prod/suremdm-jobs.

Leave A Comment

Your email address will not be published. Required fields are marked *