Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Object Storage
    • All tutorials
      • Uploading an object
      • Multipart upload of an object
      • Get a list of bucket objects
      • Getting information about an object
      • Downloading an object
      • Restoring an object's version
      • Renaming and moving objects
      • Copying objects
      • Getting a public link to an object
      • Configuring an object lock
      • Deleting an object
      • Deleting all objects
      • Deleting a partially uploaded object
      • Editing an object's ACL
      • Managing object labels
      • Managing object custom metadata
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ
  1. Step-by-step tutorials
  2. Objects
  3. Downloading an object

Downloading an object

Written by
Yandex Cloud
Improved by
Tania L.
Updated at May 5, 2025

To work with objects in an encrypted bucket, a user or service account must have the following roles for the encryption key in addition to the storage.configurer role:

  • kms.keys.encrypter: To read the key, encrypt and upload objects.
  • kms.keys.decrypter: To read the key, decrypt and download objects.
  • kms.keys.encrypterDecrypter: This role includes the kms.keys.encrypter and kms.keys.decrypter permissions.

For more information, see Key Management Service service roles.

Note

To download an object group with a specified prefix (a folder with objects) or all objects from a bucket, use the AWS CLI or file browsers compatible with the Amazon S3 API, such as CyberDuck and WinSCP.

Management console
Yandex Cloud CLI
AWS CLI
API
  1. In the management console, select Object Storage from the list of services and go to the bucket you want to download an object from.
  2. In the left-hand panel, select Objects and find the object in the list.
  3. Next to the object you want to download, click and select Download or open the object and click Download in the top panel.

Note

You can also use CyberDuck or WinSCP to download or upload objects using the GUI.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for downloading an object from a bucket:

    yc storage s3api get-object --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       |  MAX SIZE   | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | first-bucket     | b1gmit33ngp6******** | 53687091200 | STANDARD              | 2022-12-16 13:58:18 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Run this command:

    yc storage s3api get-object \
      --bucket <bucket_name> \
      --key <object_key> \
      <download_path>
    

    Where:

    • --bucket: Name of your bucket.
    • --key: Object key.
    • <download_path>: Local download path.

    Result:

    etag: '"d41d8cd98f00b204e9800998********"'
    request_id: af194b83********
    accept_ranges: bytes
    content_type: application/octet-stream
    last_modified_at: "2024-10-08T12:36:36Z"
    server_side_encryption: aws:kms
    sse_kms_key_id: abj497vtg3h0********
    

If you do not have the AWS CLI yet, install and configure it.

Downloading a single object

aws s3 cp \
  --endpoint-url=https://storage.yandexcloud.net \
  s3://<bucket_name>/<object_key> \
  <local_path>

Where:

  • --endpoint-url: Object Storage endpoint.
  • <bucket_name>: Name of the bucket you want to download the object from.
  • <object_key>: Key of the object you want to download.
  • <local_path>: Path to the directory to save the downloaded object to, e.g., ~/downloads/.

Downloading a folder (all objects with a specified prefix)

You can learn more about folders in Object Storage Directory here.

aws s3 cp \
  --endpoint-url=https://storage.yandexcloud.net \
  --recursive \
  s3://<bucket_name>/<prefix>/ \
  <local_path>

Where:

  • --endpoint-url: Object Storage endpoint.
  • --recursive: Parameter for downloading all objects with the specified prefix.
  • <bucket_name>: Name of the bucket you want to download the objects from.
  • <prefix>: Prefix (folder) of the objects you want to download, e.g., test/folder.
  • <local_path>: Path to the directory to save the downloaded objects to, e.g., ~/downloads/.

Downloading all objects from a bucket

aws s3 cp \
  --endpoint-url=https://storage.yandexcloud.net \
  --recursive \
  s3://<bucket_name> \
  <local_path>

Where:

  • --endpoint-url: Object Storage endpoint.
  • --recursive: Parameter for downloading all objects from the bucket to a local directory.
  • <bucket_name>: Name of the bucket you want to download the objects from.
  • <local_path>: Path to the directory to save the downloaded objects to, e.g., ~/downloads/.

aws s3 cp is a high-level command providing limited features. For more information, see the AWS CLI reference.

You can download bucket objects selectively using the aws s3api command and a JMESPath query template. To download objects using a query template, run this command:

  • Bash:

    aws s3api list-objects \
        --endpoint-url https://storage.yandexcloud.net \
        --bucket <bucket_name> \
        --query '<query>' \
        --output text | xargs -I {} aws s3api get-object --endpoint-url https://storage.yandexcloud.net --bucket <bucket_name> --key {} <local_path>{}
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • --bucket: Name of the bucket you want to download the objects from.
    • --query: Query in JMESPath format.
    • <local_path>: Path to the directory to save the downloaded objects to, e.g., ~/downloads/.

    Here is an example of a command that downloads all objects whose filenames start with date-20231002 from the bucket named sample-bucket to the ~/downloads/ local directory:

    aws s3api list-objects \
      --endpoint-url https://storage.yandexcloud.net \
      --bucket sample-bucket \
      --query 'Contents[?starts_with(Key, `date-20231002`) == `true`].[Key]' \
      --output text | xargs -I {} aws s3api get-object --endpoint-url https://storage.yandexcloud.net --bucket sample-bucket --key {} ~/downloads/{}
    
  • PowerShell:

    Foreach($x in (aws s3api list-objects `
      --endpoint-url https://storage.yandexcloud.net `
      --bucket <bucket_name> `
      --query '<query>' `
      --output text)) `
      {aws s3api get-object --endpoint-url https://storage.yandexcloud.net --bucket <bucket_name> --key $x <local_path>$x}
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • --bucket: Name of the bucket you want to download the objects from.
    • --query: Query in JMESPath format.
    • <local_path>: Path to the directory to save the downloaded objects to, e.g., d:\downloads\.

    Here is an example of a command that downloads all objects whose filenames start with date-20231002 from the bucket named sample-bucket to the d:\downloads\ local directory:

    Foreach($x in (aws s3api list-objects `
      --endpoint-url https://storage.yandexcloud.net `
      --bucket sample-bucket `
      --query 'Contents[?starts_with(Key, `date-20231002`) == `true`].[Key]' `
      --output text)) `
      {aws s3api get-object --endpoint-url https://storage.yandexcloud.net --bucket sample-bucket --key $x d:\downloads\$x}
    

To download an object, use the get S3 API method.

See alsoSee also

  • Getting a download link
  • Access management methods in Object Storage: Overview

Was the article helpful?

Previous
Getting information about an object
Next
Restoring an object's version
Yandex project
© 2025 Yandex.Cloud LLC