MinIO Client
MinIO Client is a command-line interface that supports connection to S3-compatible cloud services and provides modern alternatives to classic UNIX commands for working with files and folders.
Set up MinIO Client
1. Configure S3 access
Access can be configured by the Account Owner or a user with the iam.admin role.
- Create a service user with a role with S3 access. If you use a service user with the
s3.user,object_storage_user, ors3.bucket.userrole, an access policy must be configured for the bucket, and its rules must allow access to this user. - Issue an S3 key to the user.
2. Install the client
Linux
Windows
macOS
-
Open the CLI.
-
Install the client:
curl https://dl.min.io/client/mc/release/linux-amd64/mc \--create-dirs \-o $HOME/minio-binaries/mcchmod +x $HOME/minio-binaries/mcexport PATH=$PATH:$HOME/minio-binaries/
3. Configure the client
-
Add an alias:
mc alias set <alias_name> https://<s3_domain>Specify:
<alias_name>— a name for the alias (connection);<s3_domain>— the S3 API domain. The domain depends on the pool where S3 is located.
-
In the Enter Access Key field, specify the value of the Access key field from your S3 key.
-
In the Enter Secret Key field, specify the value of the Secret key field from your S3 key.
-
Test the connection:
mc ls <alias_name>Specify
<alias_name>— the alias name.A list of buckets will appear in the response.
Working with MinIO Client
List aliases
-
Open the CLI.
-
List the aliases:
mc alias list
Add an alias
-
Open the CLI.
-
Add an alias:
mc alias set <alias_name> https://<s3_domain>Specify:
<alias_name>— the alias name, which can be found using themc alias list;<s3_domain>— the S3 API domain. The domain depends on the pool where S3 is located.
Delete an alias
-
Open the CLI.
-
Delete an alias:
mc alias remove <alias_name>Specify
<alias_name>— the alias name, which can be found using themc alias list.
Create a bucket
Using MinIO Client, you can only create a bucket with the Standard storage class.
If you need a different storage class, create the bucket using other tools or the Control Panel.
-
Open the CLI.
-
Create a bucket:
mc mb <alias_name>/<bucket_name>Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name.
A private bucket will be created.
-
Optional: change the bucket type to public.
List buckets
-
Open the CLI.
-
List the buckets:
mc ls <alias_name>Specify
<alias_name>— the alias name, which can be found using themc alias list.
Enable versioning
-
Open the CLI.
-
Enable versioning:
mc version enable <alias_name>/<bucket_name>Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name.
Suspend versioning
-
Open the CLI.
-
Suspend versioning:
mc version suspend <alias_name>/<bucket_name>Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name.
List the objects in a bucket
-
Open the CLI.
-
List the objects in the bucket:
mc ls <alias_name>/<bucket_name>Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name.
Upload an object
-
Open the CLI.
-
Upload an object:
mc cp "/<local_path>" "<alias_name>/<bucket_name>/<object_name>"Specify:
<local_path>— the path to the file on your device;<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name;<object_name>— the name under which the object will be uploaded.
Download an object or folder
-
Open the CLI.
-
Download an object or folder:
mc cp "<alias_name>/<bucket_name>/<path>" "/<download_path>"Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name;<path>— the path to the object or folder in the S3 bucket;<download_path>— the path to the folder on your device where the object or folder will be downloaded.
Delete an object or folder
-
Open the CLI.
-
Delete an object or folder:
mc rm "<alias_name>/<bucket_name>/<path>"Specify:
<alias_name>— the alias name, which can be found using themc alias list;<bucket_name>— the bucket name;<path>— the path to the object or folder in the S3 bucket.