---
title: "MinIO Client"
sidebar_label: "MinIO Client"
sidebar_position: 10
description: "How to set up MinIO Client and work with S3"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import LockIcon from '@selectel/docux/icons/lock'
import GrantAccess from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/s3/grant-access.mdx'

# 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](#configure-s3-access).
2. [Install the client](#install-client).
3. [Configure the client](#configure-client).

### 1. Configure S3 access \{#configure-s3-access}

<GrantAccess />

### 2. Install the client \{#install-client}

<Tabs queryString="install-client">
  <TabItem value="linux" default>
    <TabItemLabel>
      Linux
    </TabItemLabel>

    1. Open the CLI.
    2. Install the client:

       ```bash
       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/
       ```
  </TabItem>

  <TabItem value="windows">
    <TabItemLabel>
      Windows
    </TabItemLabel>

    1. Download MinIO Client from the [official website](https://dl.min.io/client/mc/release/windows-amd64/mc.exe) of the developer.

    2. Add the `MinIO Client` folder to the `PATH` variable:

       2.1. In the Windows search bar, type **Edit the system environment variables**.

       2.2. Click **Environment Variables**.

       2.3. Select the `PATH` variable.

       2.4. Click **Edit** → **New**.

       2.5. Add the path to the folder to the list.

       2.6. Click **OK** → **OK**.

    3. To apply the environment variable settings, restart your device.

    4. Verify that the client is installed:

       4.1. Open PowerShell.

       4.2. Verify that the client is installed:

       ```bash
       mc --version
       ```

    5. If a certificate verification error occurs, to establish a secure connection:

       5.1. In your browser, go to `https://<s3_domain>`. Specify `<s3_domain>` — [S3 API domain](/s3/manage/domains.mdx#s3-api-domains) depending on the pool where your bucket is located.

       5.2. In the address bar, click <LockIcon /> 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 **Details** tab.

       5.6. Click **Copy to File.**..

       5.7. Save the file in Base-64 encoded X.509 format (`.cer`).
  </TabItem>

  <TabItem value="macos">
    <TabItemLabel>
      macOS
    </TabItemLabel>

    The MinIO Client is installed using the [Homebrew](https://brew.sh/) package manager.

    1. Open Terminal.
    2. Install the client:

       ```bash
       brew install minio/stable/mc
       ```
  </TabItem>
</Tabs>

### 3. Configure the client \{#configure-client}

1. Add an alias:

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

   Specify:

   * `<alias_name>` — the alias (connection) name;
   * `<s3_domain>` — [S3 API domain](/s3/manage/domains.mdx#s3-api-domains). The domain depends on the [pool](/infrastructure/locations.mdx#pool) where S3 is located.

2. In the **Enter Access Key** field, specify the value of the **Access key** field from the [S3 key](#configure-s3-access).

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

4. Test the connection:

   ```bash
   mc ls <alias_name>
   ```

   Specify `<alias_name>` — the alias name.

   A list of buckets will appear in the response.

## Working with MinIO Client \{#work-with-minio-client}

### List aliases \{#list-aliases}

1. Open the CLI.
2. List the aliases:

   ```bash
   mc alias list
   ```

### Add an alias \{#add-alias}

1. Open the CLI.
2. Add an alias:

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

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<s3_domain>` — [S3 API domain](/s3/manage/domains.mdx#s3-api-domains). The domain depends on the [pool](/infrastructure/locations.mdx#pool) where S3 is located.

### Delete an alias \{#delete-alias}

1. Open the CLI.
2. Delete an alias:

   ```bash
   mc alias remove <alias_name>
   ```

   Specify `<alias_name>` — the alias name; you can view it using the `mc alias list` command.

### Create a bucket \{#create-bucket}

:::info

You can only create a bucket with the [standard storage class](/s3/about/payment.mdx#storage-types) using MinIO Client.

If you need a different storage class, create the bucket using other [tools](/s3/tools/) or the control panel.

:::

1. Open the CLI.

2. Create a bucket:

   ```bash
   mc mb <alias_name>/<bucket_name>
   ```

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name.

   A private bucket will be created.

3. Optional: [change the bucket type](/s3/buckets/change-bucket-type.mdx) to public.

### List buckets \{#list-buckets}

1. Open the CLI.
2. List the buckets:

   ```bash
   mc ls <alias_name>
   ```

   Specify `<alias_name>` — the alias name; you can view it using the `mc alias list` command.

### Enable versioning \{#enable-versioning}

1. Open the CLI.
2. Enable versioning:

   ```bash
   mc version enable <alias_name>/<bucket_name>
   ```

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name.

### Suspend versioning \{#suspend-versioning}

1. Open the CLI.
2. Suspend versioning:

   ```bash
   mc version suspend <alias_name>/<bucket_name>
   ```

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name.

### List the objects in a bucket \{#list-objects-in-bucket}

1. Open the CLI.
2. List the objects in the bucket:

   ```bash
   mc ls <alias_name>/<bucket_name>
   ```

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name.

### Upload an object \{#upload-object}

1. Open the CLI.
2. Upload an object:

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

   Specify:

   * `<local_path>` — the path to the file on the device;
   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name;
   * `<object_name>` — the name the object will be uploaded with.

### Download an object or folder \{#download-object-or-folder}

1. Open the CLI.
2. Download an object or folder:

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

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<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 the device where the object or folder will be downloaded.

### Delete an object or folder \{#delete-object-or-folder}

1. Open the CLI.
2. Delete an object or folder:

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

   Specify:

   * `<alias_name>` — the alias name; you can view it using the `mc alias list` command;
   * `<bucket_name>` — the bucket name;
   * `<path>` — the path to the object or folder in the S3 bucket.

<Formbricks />
