---
title: "S3cmd"
sidebar_label: "S3cmd"
sidebar_position: 4
description: "How to configure S3cmd and use object storage via the S3cmd command-line interface"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import GrantAccess from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/s3/grant-access.mdx'

# S3cmd

[S3cmd](https://s3tools.org/s3cmd) is a command-line interface for services that support the Amazon S3 HTTP API ([S3 API](/api/object-storage-s3/)).

## Configure S3cmd \{#configure-s3cmd}

1. [Configure access to S3](#configure-s3-access).
2. [Install the client](#install-client).
3. [Create an S3cmd configuration](#create-configuration).

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

<GrantAccess />

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

Download and install the client from [GitHub S3cmd](https://github.com/s3tools/s3cmd/blob/master/INSTALL.md).

### 3. Create an s3cmd configuration \{#create-configuration}

1. Open the terminal.

2. Open the configuration mode:

   ```bash
   s3cmd --configure
   ```

3. Enter the `Access Key` — the value of the **Access key** field from the [S3 key](#configure-s3-access).

4. Enter `Secret Key` — the value of the **Secret key** field from your S3 key.

5. Enter `Default Region` — the [pool](/infrastructure/locations.mdx#pool).

6. Enter `S3 Endpoint` — the [S3 API domain](/s3/manage/domains.mdx#s3-api-domains). The domain depends on the [pool](/infrastructure/locations.mdx#pool) where your S3 is located.

7. Enter the DNS-style `bucket+hostname:port template for accessing a bucket` — the [S3 API domain](/s3/manage/domains.mdx#s3-api-domains). The domain depends on the [pool](/infrastructure/locations.mdx#pool) where your S3 is located. The settings will be saved in the `~/.s3cfg` file:

   ```bash
   [default]
      access_key = <access_key>
      secret_key = <secret_key>
      bucket_location = <pool>
      host_base = <s3_domain>
      host_bucket = <s3_domain>
   ```

## Working with S3cmd \{#working-with-s3cmd}

All commands can be found in the [Usage](https://s3tools.org/usage) section of the S3cmd documentation.

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

1. Open the terminal.
2. Create a bucket:

   ```bash
   s3cmd mb s3://<bucket_name>
   ```

   Specify `<bucket_name>` — the name of the new bucket.

### View the list of objects \{#view-object-list}

1. Open the terminal.
2. View the list of objects:

   ```bash
   s3cmd ls s3://<bucket_name>
   ```

   Specify `<bucket_name>` — the name of the bucket.

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

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

   ```bash
   s3cmd put <path> s3://<bucket_name>/<prefix>
   ```

   Specify:

   * `<path>` — path to the file in the local directory;
   * `<bucket_name>` — bucket name;
   * `<prefix>` — optional: the [prefix](/s3/objects/manage-folder.mdx) to which the object will be uploaded.

### Remove an object \{#delete-object}

1. Open the terminal.
2. Remove an object:

   ```bash
   s3cmd rm s3://<bucket_name>/<object_name>
   ```

   Specify:

   * `<bucket_name>` — bucket name;
   * `<object_name>` — the name of the object.

<Formbricks />
