Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
        • Pushing a binary artifact to a registry
        • Pulling a binary artifact from a registry
      • Deleting an artifact from a registry
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Binary artifact
  4. Pushing a binary artifact to a registry

Pushing a binary artifact to a registry

Written by
Yandex Cloud
Updated at November 17, 2026
View in Markdown
  1. Create the following environment variables depending on the authentication method:

    IAM token
    API key
    1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

    2. Create the REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables:

      export REGISTRY_USERNAME="iam"
      export REGISTRY_PASSWORD="<IAM_token>"
      

      Where:

      • REGISTRY_USERNAME: Authentication method.
      • REGISTRY_PASSWORD: Body of the previously obtained IAM token.

    Note

    The IAM token's lifetime is limited to 12 hours.

    1. Create an API key for the service account you are going to use for authentication.

      When creating a key, specify its scope:

      • yc.cloud-registry.artifacts.pull: To pull artifacts from the registry.
      • yc.cloud-registry.artifacts.push: To push artifacts to the registry.
    2. Create the REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables:

      export REGISTRY_USERNAME="api_key"
      export REGISTRY_PASSWORD="<API_key>"
      

      Where:

      • REGISTRY_USERNAME: Authentication method.
      • REGISTRY_PASSWORD: Body of the previously created API key.

    Note

    The API key maximum lifetime is set manually when you create the key.

  2. To push a binary artifact, use a POST HTTP request:

    curl \
      --request PUT \
      --user "$REGISTRY_USERNAME:$REGISTRY_PASSWORD" \
      --header "X-Checksum-SHA256: <file_hash>" \
      --upload-file <local_path_to_file> \
      https://registry.yandexcloud.net/binaries/<registry_ID>/<artifact_name>/<artifact_version>/<file_name_in_registry>
    

    Where:

    • --request: Method.

    • --user: Authentication data.

    • --header: API request header. This is an optional setting.

      In the X-Checksum-SHA256 header, you can specify the hash of the file you are pushing to check the file’s integrity after it is pushed. You can generate the hash, e.g., using this command:

      openssl dgst -sha256 <file_path> | awk '{print $2}'
      
    • --upload-file: Local path to the file to upload.

    • The request URL contains the registry URL, the artifact name and version, as well as the file name in the registry. Here is an example:

      https://registry.yandexcloud.net/binaries/cn15fqbr806r********/sample-package/3.5.4/agent-installer.sh
      

Scope is an API key parameter that restricts the key's use to specific operations in addition to the service account's access permissions. For details, see API keys with scope and validity limits.

Was the article helpful?

Previous
Examples of working with PyPI registries
Next
Pulling a binary artifact from a registry
© 2026 Direct Cursus Technology L.L.C.