Skip to main content

MinIO Client

MinIO Client is a command line interface that supports connection to S3-compatible cloud services and offers a modern analog of classic UNIX commands for working with files and folders.

To configure the MinIO Client

  1. Configure access to S3.
  2. Install the client.
  3. Customize the client.

1. Set up access to S3

Access can be configured by the Account Owner or a user with the role of iam_admin.

  1. Create a service user с role with access to S3. If you use a service user with the role object_storage_user or s3.bucket.user, the bucket must have an access access policy.
  2. Issue an S3 key to the user.

2. Install the client

  1. Open the CLI.

  2. Install the client:

    curl https://dl.min.io/client/mc/release/linux-amd64/mc \
    --create-dirs \
    -o $HOME/minio-binaries/mc

    chmod +x $HOME/minio-binaries/mc
    export PATH=$PATH:$HOME/minio-binaries/

3. Configure the client

  1. Add an alias:

    mc alias set <alias_name>  https://<s3_domain>

    Specify:

    • <alias_name> — name for alias (connection);
    • <s3_domain> — S3 API domain depends on pool in which S3 is located.
  2. In the Enter Access Key field, enter the value of the Access key field from the S3 key.

  3. In the Enter Secret Key field, enter the value of  the Secret key field from the S3 key.

  4. Check the connection:

    mc ls <alias_name>

    Specify < alias_name > — alias name.

    A list of bucket list will appear in the response.

Working with MinIO Client

Print the list of aliases

  1. Open the CLI.

  2. Print the list of aliases:

    mc alias list

Add an alias

  1. Open the CLI.

  2. Add an alias:

    mc alias set <alias_name> https://<s3_domain>

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <s3_domain> — S3 API domain depends on pool in which S3 is located.

Delete alias

  1. Open the CLI.

  2. Delete the alias:

    mc alias remove <alias_name>

    Specify < alias_name > — alias name, can be viewed with the mc alias list command.

Create bucket

For your information

Through the MinIO Client, you can only create a bucket with a standard storage class.

If you need a different storage class, create a bucket through other tools or the control panel.

  1. Open the CLI.

  2. Create a baquette:

    mc mb <alias_name>/<bucket_name>

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name.

    A private bucket will be created.

  3. Optional: change the bucket type to public.

Output the list of baquettes

  1. Open the CLI.

  2. Bring up a list of baquettes:

    mc ls <alias_name>

    Specify < alias_name > — alias name, can be viewed with the mc alias list command.

Enable versioning

  1. Open the CLI.

  2. Enable versioning:

    mc version enable <alias_name>/<bucket_name>

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name.

Suspend versioning

  1. Open the CLI.

  2. Suspend versioning:

    mc version suspend <alias_name>/<bucket_name>

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name.

Print the list of objects in the baquette

  1. Open the CLI.

  2. Output the list of objects in the baquette:

    mc ls <alias_name>/<bucket_name>

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name.

Load object

  1. Open the CLI.

  2. Load the object:

    mc cp "/<local_path>" "<alias_name>/<bucket_name>/<object_name>"

    Specify:

    • <local_path> — path to the file on the device;
    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name;
    • <object_name> — name with which the object will be loaded.

Download an object or folder

  1. Open the CLI.

  2. Download the object or folder:

    mc cp "<alias_name>/<bucket_name>/<path>" "/<download_path>"

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name;
    • <path> — path to an object or folder in the S3 package;
    • <download_path> — path to the folder on the device where the object or folder will be downloaded.

Delete an object or folder

  1. Open the CLI.

  2. Delete an object or folder:

    mc rm "<alias_name>/<bucket_name>/<path>"

    Specify:

    • <alias_name> — alias name, can be viewed with the command mc alias list;
    • <bucket_name> — bucket name;
    • <path> — path to an object or folder in the S3 package.