---
title: "Object Storage Swift - Getting started"
description: "The Object Storage Swift solution for Public Cloud offers unlimited storage with simple billing tailored to your needs. Containers can be configured for differe"
url: https://docs.us.ovhcloud.com/en/storage-and-backup/object-storage/pcs-create-container
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# Object Storage Swift - Getting started

The Object Storage Swift solution for Public Cloud offers unlimited storage with simple billing tailored to your needs. Containers can be configured for different use cases:

- Static hosting (static website)
- Private hosting (e.g. personal data storage)
- Public hosting (publicly accessible content)
- Cold storage (archiving)

 

## Requirements

- A [Public Cloud project](https://docs.us.ovhcloud.com/en/public-cloud/cross-functional/create-a-public-cloud-project.md) in your OVHcloud account

- Depending on the tool you plan to use:

  - **Swift S3**[**1**](#go-further)**&#x20;API**: An environment [prepared for the OpenStack API](https://docs.us.ovhcloud.com/en/public-cloud/cross-functional/compute-prepare-openstack-api-environment.md) with `python-openstackclient` and `awscli` installed
  - **Swift client**: An environment [prepared for the OpenStack API](https://docs.us.ovhcloud.com/en/public-cloud/cross-functional/compute-prepare-openstack-api-environment.md) with `python-swiftclient` installed
  - **OVHcloud CLI**: The [OVHcloud CLI](https://docs.us.ovhcloud.com/en/manage-and-operate/cli/getting-started-ovhcloud-cli.md) installed and configured

***

### OVHcloud Control Panel Access

- **Direct link:** [Public Cloud Projects](https://manager.us.ovhcloud.com/#/public-cloud/pci/projects)
- **Navigation path:** `Public Cloud` > Select your project

***

 

## Instructions

### Preparation

#### OVHcloud Control Panel

Log in to your OVHcloud Control Panel and open `Object Storage` in the left-hand menu under **Storage & backup**.

#### Swift S3 API

**Set the OpenStack environment variables**
```
source <user_name>-openrc.sh
Please enter your OpenStack Password for project <project_name> as user <user_name>:
```
**Install the OpenStack client if needed**
```
pip install python-openstackclient
```
OpenStack client command reference: [docs.openstack.org](https://docs.openstack.org/python-openstackclient/latest/)
**Create EC2 credentials**
S3 tokens require two parameters — **access** and **secret** — generated from Keystone:
```
openstack ec2 credentials create
+------------+----------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                  |
+------------+----------------------------------------------------------------------------------------------------------------------------------------+
| access     | 5a4d8b8d88104123a862c527ede5a3d3                                                                                                       |
| links      | {u'self': u'https://auth.cloud.ovh.us/v3/users/d74d05ff121b44bea9216495e7f0df61/credentials/OS-EC2/5a4d8b8d88104123a862c527ede5a3d3'} |
| project_id | 20e124b71be141299e111ec26b1892fa                                                                                                       |
| secret     | 925d5fcfcd9f436d8ffcb20548cc53a2                                                                                                       |
| trust_id   | None                                                                                                                                   |
| user_id    | d74d05ff121b44bea9216495e7f0df61                                                                                                       |
+------------+----------------------------------------------------------------------------------------------------------------------------------------+
```
**Configure the AWS client**
Install `awscli`:

#### Python package

```
pip install awscli
```

#### Debian-based OS

```
sudo apt install awscli
```

#### RHEL-based OS

```
sudo yum install awscli
```

Then configure it with the EC2 credentials generated above:

#### CLI method

```
aws configure
```
Follow the prompts and enter your access key and secret key when asked.

#### Manual method

```
cat ~/.aws/credentials
```
```
[default]
aws_access_key_id = <access_key>
aws_secret_access_key = <secret_key>
```
```
cat ~/.aws/config
```
```
[plugins]
endpoint = awscli_plugin_endpoint
[default]
region = <region>
s3 =
  endpoint_url = https://s3.<region>.cloud.ovh.us
  signature_version = s3v4
s3api =
  endpoint_url = https://s3.<region>.cloud.ovh.us
```

**Note:** Both virtual-hosted-style and path-style access are supported; virtual-hosted-style is recommended, as path-style was deprecated after September 30, 2020.

##### Swift client

Set the OpenStack environment variables:
```
source <user_name>-openrc.sh
```
Verify your setup:
```
swift --help
```
For the full list of Swift commands, refer to the [OpenStack documentation](https://docs.openstack.org/python-swiftclient/latest/cli/index.html).

##### OVHcloud CLI

Ensure the OVHcloud CLI is installed and configured with your credentials. For setup instructions, refer to the [OVHcloud CLI documentation](https://docs.us.ovhcloud.com/en/manage-and-operate/cli/getting-started-ovhcloud-cli.md).

 

### Create a container

**Note:**

When using the **Swift S3 API**, bucket names must follow these rules:

- Between 3 and 63 characters long
- Lowercase letters, numbers, periods, and dashes only
- Must start with a lowercase letter or number
- No underscores, no consecutive periods, no dashes adjacent to periods
- Not formatted as an IP address (e.g. `198.51.100.24`)

#### OVHcloud Control Panel

Click `Create an object container`.
Fill in the creation form:
- **Container name**: Enter a name for your container.
- **Container type**: Select `Swift API`.
- **Location**: Choose an available location.
- **Container type**: Choose the access type **Static hosting**, **Private**, or **Public**.

Review the summary panel, then click `Create`.

#### Swift S3 API

```
aws s3 mb s3://<container_name>
```

**Note:** S3 buckets can only be created on the PCS (Object Storage) policy.

#### Swift client

Create the container:
```
swift post container1
```
To make the container publicly accessible:
```
swift post --header "X-Container-Read: .r:*" container1
```
Verify the configuration:
```
swift stat container1

Account: AUTH_b3e26xxxxxxxxxxxxxxxxxxxb0ba29
Container: container1
Objects: 0
Bytes: 0
Read ACL: .r:*
Write ACL:
Sync To:
Sync Key:
Accept-Ranges: bytes
X-Trans-Id: B2210C05:8D93_052711A1:01BB_561CC9DF_1B305:30D7
X-Storage-Policy: Policy-0
Connection: close
X-Timestamp: 1444726875.27475
Content-Type: text/plain; charset=utf-8
```

#### OVHcloud CLI

Container creation is not available via the OVHcloud CLI. Use the Control Panel, the Swift S3 API, or the Swift client instead.

 

### List your containers

#### OVHcloud Control Panel

Navigate to `Object Storage` in the left-hand menu. Your containers are listed under the `My containers` tab.

#### Swift S3 API

```
aws s3 ls
```

**Note:** If you have more than one profile configured, add `--profile <profile_name>` to the command.

#### Swift client

```
swift list
```

#### OVHcloud CLI

```
ovhcloud cloud storage swift list
```

 

### Upload objects

#### OVHcloud Control Panel

Click on the name of your container, then click `Add objects` in the **Objects** tab.
Select the file you want to upload and click `Import`.

#### Swift S3 API

```
aws s3 cp /path/to/<object_name> s3://<container_name>/<object_name>
```

#### Swift client

Upload a single file:
```
swift upload container1 file.txt
```
Upload an entire folder (a prefix matching the folder name is automatically added to the objects):
```
swift upload container1 images/

images/OVHlogo.png
images/OVHSummitKeynote.jpg
```

#### OVHcloud CLI

Object upload is not available via the OVHcloud CLI. Use the Control Panel, the Swift S3 API, or the Swift client instead.

 

### List objects in a container

#### OVHcloud Control Panel

Click on the name of your container to view its objects in the **Objects** tab.

#### Swift S3 API

```
aws s3 ls s3://<container_name>
```

#### Swift client

```
swift list container1

images/OVHSummitKeynote.jpg
images/OVHlogo.png
text1.txt
text2.txt
text3.txt
```
Filter by prefix:
```
swift list container1 --prefix images

images/OVHSummitKeynote.jpg
images/OVHlogo.png
```
If the container is public, objects are accessible directly via URL:
```
https://storage.us-east-va.cloud.ovh.us/v1/AUTH_b3e26xxxxxxxxxxxxxxxxxxxb0ba29/container1/images/OVHlogo.png
```
This URL is composed of an endpoint (available from the [Horizon interface](https://docs.us.ovhcloud.com/en/public-cloud/cross-functional/compute-horizon-access-security.md)), the container name, and the object name (including prefix).

#### OVHcloud CLI

Object listing is not available via the OVHcloud CLI. Use the Control Panel, the Swift S3 API, or the Swift client instead.

 

### Download objects

#### OVHcloud Control Panel

Click the download icon on the object line.

#### Swift S3 API

```
aws s3 cp s3://<container_name>/<object_name> .
```

#### Swift client

Download a single file:
```
swift download container1 text1.txt

text1.txt [auth 0.328s, headers 0.452s, total 0.453s, 0.000 MB/s]
```
Download all files with a given prefix:
```
swift download container1 --prefix images

images/OVHlogo.png [auth 0.383s, headers 0.520s, total 0.522s, 0.135 MB/s]
images/OVHSummitKeynote.jpg [auth 0.371s, headers 0.514s, total 0.559s, 2.657 MB/s]
```

#### OVHcloud CLI

Object download is not available via the OVHcloud CLI. Use the Control Panel, the Swift S3 API, or the Swift client instead.

 

### Delete objects and containers

#### OVHcloud Control Panel

**Delete an object**: Click the delete icon (trash can) on the object line and confirm.
**Delete a container**: Click the _more options_ `...` button on the container line, then select `Delete` and confirm.

#### Swift S3 API

**Delete an object:**
```
aws s3 rm s3://<container_name>/<object_name>
```
**Delete a container** (the container must be empty first):
```
aws s3 rb s3://<container_name>
```

#### Swift client

**Delete a file:**
```
swift delete container1 text1.txt

text1.txt
```
Delete multiple files using a prefix:
```
swift delete container1 images/*

images/OVHSummitKeynote.jpg
images/OVHlogo.png
```
**Delete a container** (also deletes all objects inside it):
```
swift delete container1

text2.txt
text3.txt
```

#### OVHcloud CLI

Container and object deletion is not available via the OVHcloud CLI. Use the Control Panel, the Swift S3 API, or the Swift client instead.

 

## Go further

Browse all the [Object Storage (S3™-compatible) guides](https://docs.us.ovhcloud.com/en/storage-and-backup/object-storage/landing-page-object-storage.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [Object Storage](https://us.ovhcloud.com/public-cloud/object-storage/) on the OVHcloud US website.

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://us.ovhcloud.com/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.

\*S3 is a trademark filed by Amazon Technologies, Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies, Inc.
