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.
Access can be configured by the Account Owner or a user with the role of iam_admin.
- 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. - Issue an S3 key to the user.
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/mc
chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/
-
On the developer's official website, download the MinIO Client.
-
Add the
MinIO Clientfolder to thePATHvariable:2.1 In a Windows search, type Change System Environment Variables.
2.2 Click Environment Variables.
2.3. Select the
PATHparameter.2.4. Click Edit → New.
2.5 Add the folder path to the list.
2.6. Press OK → OK.
-
For the variable environment settings to be applied, reboot the device.
-
Make sure the client is installed:
4.1 Open PowerShell.
4.2 Make sure the client is installed:
mc --version -
If an error occurs with certificate verification, to connect securely:
5.1 In a browser, go to
https://<s3_domain>. Specify<s3_domain>— the domain of the S3 API depending on the pool in which the bucket resides.5.2 In the address bar, click and download the certificate.
5.3 Download the certificate and save it on the server.
5.4 Open the certificate file.
5.5 Open the Composition tab.
5.6. Click Copy to file.
5.7. Save the file in Base-64 encoded X.509 (
.cer) format.
MinIO Client is installed using the Homebrew package manager.
-
Open Terminal.
-
Install the client:
brew install minio/stable/mc
-
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.
-
In the Enter Access Key field, enter the value of the Access key field from the S3 key.
-
In the Enter Secret Key field, enter the value of the Secret key field from the S3 key.
-
Check the connection:
mc ls <alias_name>Specify
<alias_name>— alias name.A list of bucket list will appear in the response.
-
Open the CLI.
-
Print the list of aliases:
mc alias list
-
Open the CLI.
-
Add an alias:
mc alias set <alias_name> https://<s3_domain>Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<s3_domain>— S3 API domain depends on pool in which S3 is located.
-
Open the CLI.
-
Delete the alias:
mc alias remove <alias_name>Specify
<alias_name>— alias name, can be viewed with themcaliaslistcommand.
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.
-
Open the CLI.
-
Create a baquette:
mc mb <alias_name>/<bucket_name>Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<bucket_name>— bucket name.
A private bucket will be created.
-
Optional: change the bucket type to public.
-
Open the CLI.
-
Bring up a list of baquettes:
mc ls <alias_name>Specify
<alias_name>— alias name, can be viewed with themcaliaslistcommand.
-
Open the CLI.
-
Enable versioning:
mc version enable <alias_name>/<bucket_name>Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<bucket_name>— bucket name.
-
Open the CLI.
-
Suspend versioning:
mc version suspend <alias_name>/<bucket_name>Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<bucket_name>— bucket name.
-
Open the CLI.
-
Output the list of objects in the baquette:
mc ls <alias_name>/<bucket_name>Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<bucket_name>— bucket name.
-
Open the CLI.
-
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 commandmc alias list;<bucket_name>— bucket name;<object_name>— name with which the object will be loaded.
-
Open the CLI.
-
Download the object or folder:
mc cp "<alias_name>/<bucket_name>/<path>" "/<download_path>"Specify:
<alias_name>— alias name, can be viewed with the commandmc 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.
-
Open the CLI.
-
Delete an object or folder:
mc rm "<alias_name>/<bucket_name>/<path>"Specify:
<alias_name>— alias name, can be viewed with the commandmc alias list;<bucket_name>— bucket name;<path>— path to an object or folder in the S3 package.