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, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/storage-and-backup/object-storage/getting-started.md.
  • English

Getting started with Object Storage

View as Markdown
Info

If you are using legacy Swift Object Storage, follow this guide.

For new projects, we highly recommend using our S3™*-compatible Object Storage, which benefits from our latest innovations and new features.

 

Requirements

OVHcloud Control Panel Access

 

Instructions

Info

If you wish to use the OVHcloud Terraform provider, see our Manage an Object Storage bucket with Terraform guide.

Preparation

To use the AWS CLI

To find out how to install the AWS CLI in your environment, we recommend you read the official AWS documentation.

Check installation

aws --version
Info

If you need more information about AWS CLI installation, read the AWS documentation.

 

Collect Credentials

  • Retrieve your user's Access key and Secret key. You can retrieve this information from the OVHcloud Control Panel under Public Cloud > Object Storage > Users.
  • You will also need your endpoint_url and the region. If you have already created your container, find this information in the My containers tab in the details of your container. If needed, see our Object Storage - Endpoints and geoavailability guide.

 

Where to find the Endpoint URL of a container

Click the name of the container and then the General information tab.

Object storage container dashboard enabled

 

Configuration

Use the interactive configuration to generate the configuration files, or create them manually.

Info

To use the interactive configuration, run the following command: aws --configure or aws configure --profile <profile_name>

The configuration file format in the AWS client is as follows:

cat ~/.aws/credentials

[default]
aws_access_key_id = <access_key>
aws_secret_access_key = <secret_key>
cat ~/.aws/config

[default]
region = <region_in_lowercase>
endpoint_url = <endpoint_url>
services = ovh-us-east-va-archive

[profile <profile_name>]
region = us-east-va
output = json
services = ovh-us-east-va

[services ovh-us-east-va-archive]
s3 =
  endpoint_url = https://s3.us-east-va-archive.io.cloud.ovh.us/
  signature_version = s3v4

s3api =
  endpoint_url = https://s3.us-east-va-archive.io.cloud.ovh.us/

[services ovh-us-east-va]
s3 =
  endpoint_url = https://s3.us-east-va.io.cloud.ovh.us/
  signature_version = s3v4

s3api =
  endpoint_url = https://s3.us-east-va.io.cloud.ovh.us/

Here are the configuration values you can set:

VariableTypeValueDefinition
max_concurrent_requestsIntegerDefault: 10The maximum number of simultaneous requests.
max_queue_sizeIntegerDefault: 1000The maximum number of tasks in the task queue.
multipart_thresholdInteger StringDefault: 8 MBThe size threshold that the CLI uses for multipart transfers of individual files.
multipart_chunksizeInteger StringDefault: 8 MB Minimum for uploads: 5 MBWhen using multipart transfers, this is the byte size that the CLI uses for multipart transfers of individual files.
max_bandwidthIntegerDefault: NoneThe maximum bandwidth that will be used to load and download data to and from your buckets.
verify_sslBooleanDefault: trueEnable / Disable SSL certificate verification

For a list of endpoints by region and storage class, see the Object Storage - Endpoints and geoavailability guide.

 

Usage

Info

If you have more than one profile, add --profile <profile_name> to the command line.

Using the OVHcloud Control Panel

To manage an Object Storage bucket, navigate to Object Storage in the left-hand menu.

 

Listing your buckets

Via the AWS CLI
Via the OVHcloud Control Panel
Via the OVHcloud CLI
Via AWS s3
aws s3 ls
Via AWS S3API
aws s3api list-buckets --query "Buckets[].Name" # Remove --query to display the full output.

 

Create a bucket

Via the AWS CLI
Via the OVHcloud Control Panel
Via the OVHcloud CLI
Via AWS s3
aws s3 mb s3://<bucket_name>
aws --profile <profile_name> s3 mb s3://<bucket_name>
Via AWS S3API
aws s3api create-bucket --bucket <bucket_name>
aws s3api create-bucket --bucket <bucket_name> --profile default

 

Uploading your files as objects in your bucket

When uploading objects, select a storage class to control availability, redundancy, and cost. To help you choose the right storage class for your needs, see the Choosing the right storage class for your needs guide.

Via the AWS CLI
Via the OVHcloud Control Panel
Info

The aws s3 cp command will use STANDARD as default storage class for uploading objects. To store objects in the High Performance tier, use the aws s3api put-object command instead, as aws s3 cp does not support the EXPRESS_ONEZONE storage class, which is used to map the High Performance storage tier. To learn more about the storage class mapping between OVHcloud storage tiers and AWS storage classes, you can check our documentation here.

Via AWS s3

To upload an object:

aws s3 cp /data/<object_name> s3://<bucket_name>

By default, objects are named after files, but can be renamed:

aws s3 cp /data/<object_name> s3://<bucket_name>/other-filename

 

Downloading an object from a bucket

Via the AWS CLI
Via the OVHcloud Control Panel
Via AWS s3

Downloading an object from a bucket:

aws s3 cp s3://<bucket_name>/<object_name> .

Uploading an object from one bucket to another bucket:

aws s3 cp s3://<bucket_name>/<object_name> s3://<bucket_name_2>/<object_name>

Downloading or uploading an entire bucket to the host/bucket:

aws s3 cp s3://<bucket_name> . --recursive
aws s3 cp s3://<bucket_name> s3://<bucket_name_2> --recursive
Via AWS S3API

Downloading an object from a bucket:

aws s3api get-object --bucket <bucket_name> --key <object_name> <object_name>

Uploading an object from one bucket to another bucket:

aws s3api copy-object --bucket <bucket_name_2> --copy-source <bucket_name>/<object_name> --key <object_name>

 

Synchronizing buckets

Via AWS CLI

aws s3 sync . s3://<bucket_name> # Synchronizing local directory to the S3 bucket
aws s3 sync s3://<bucket_name> . # Synchronizing S3 bucket to the local directory
aws s3 sync s3://<bucket_name> s3://<bucket_name_2> # Synchronizing an S3 bucket to another one

 

Deleting objects and buckets

Info

A bucket can only be deleted if it is empty.

Via the AWS CLI
Via the OVHcloud Control Panel
Via the OVHcloud CLI
Info

If your bucket has Object Lock enabled, you will not be able to permanently delete your objects. See our documentation to learn more about Object Lock. If you use Object Lock in GOVERNANCE mode and have the permission to bypass GOVERNANCE mode, you will have to add the --bypass-governance-retention option to your delete commands.

Via AWS s3

To delete an object:

aws s3 rm s3://<bucket_name>/<object_name>

To remove all objects from a bucket:

aws s3 rm s3://<bucket_name> --recursive

To delete a bucket, it must be empty:

aws s3 rb s3://<bucket_name>

If the bucket is not removed, you can use the same command with the --force option. This deletes all objects from the bucket, and then deletes the bucket.

aws s3 rb s3://<bucket_name> --force

Deleting objects and buckets with versioning enabled:

If versioning is enabled, a standard delete operation on your objects will not permanently remove them.

To permanently delete an object, you must specify a version ID:

aws s3api delete-object --bucket <NAME> --key <KEY> --version-id <VERSION_ID>

To list all objects and their version IDs, you can use the following command:

aws s3api list-object-versions --bucket <NAME>

With the above delete-object command, you will have to iterate over all your object versions. You can also use the following one-liner to empty your bucket:

aws s3api delete-objects --bucket <NAME> --delete "$(aws s3api list-object-versions --bucket <NAME> --query='{Objects: Versions[].{Key:Key,VersionId:VersionId}}')"
Via AWS S3API

Deleting objects and buckets:

# Delete an object
aws s3api delete-object --bucket <bucket_name> --key <object_name>
# Removing all objects from a bucket
aws s3api delete-objects --bucket <bucket_name> --delete "$(aws s3api list-objects-v2 --bucket <bucket_name> --query='{Objects: Contents[].{Key:Key}}')"
# Delete a bucket. To delete a bucket, it must be empty.
aws s3api delete-bucket --bucket <bucket_name>

Deleting objects and buckets with versioning enabled:

If versioning is enabled, a standard delete operation on your objects will not permanently delete them.

To permanently delete an object, you need to specify a version identifier:

aws s3api delete-objects --bucket <bucket_name> --delete "$(aws s3api list-object-versions --bucket <bucket_name> --query='{Objects: Versions[].{Key:Key,VersionId:VersionId}}')"

 

Manage tags

Via the AWS CLI
Via the OVHcloud CLI
Via AWS S3API

Setting tags on a bucket:

aws s3api put-bucket-tagging --bucket <bucket_name> --tagging 'TagSet=[{Key=myKey,Value=myKeyValue}]'
aws s3api get-bucket-tagging --bucket <bucket_name>
{
  "TagSet": [
    {
    "Value": "myKeyValue",
    "Key": "myKey"
    }
  ]
}

Deleting tags on a bucket:

aws s3api delete-bucket-tagging --bucket <bucket_name>

Setting tags on an object:

aws s3api put-object-tagging --bucket <bucket_name> --key <object_name> --tagging 'TagSet=[{Key=myKey,Value=myKeyValue}]'
aws s3api get-bucket-tagging --bucket <bucket_name>
{
  "TagSet": [
    {
    "Value": "myKeyValue",
    "Key": "myKey"
    }
  ]
}

Deleting tags on an object:

aws s3api delete-object-tagging --bucket <bucket_name> --key <object_name>

 

Go further

Browse all the Object Storage (S3™-compatible) guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Object Storage on the OVHcloud US website.

*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.