Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
        • Creating a Go module
        • Pulling a Go module to the registry
        • Pushing a Go module from the registry
      • Deleting an artifact from a registry
    • Creating a lifecycle policy
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Go artifact
  4. Pulling a Go module to the registry

Pulling a Go module to the registry

Written by
Yandex Cloud
Updated at July 8, 2026
View in Markdown

Before pushing, prepare a ZIP archive of your Go module. For more information, see Creating a Go module.

  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.

    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. Push the Go module using a PUT HTTP request:

    curl \
      --request PUT \
      --user "$REGISTRY_USERNAME:$REGISTRY_PASSWORD" \
      --header "X-Checksum-SHA256: <file_hash>" \
      --upload-file <local_path_to_ZIP_file> \
      https://registry.yandexcloud.net/go/<registry_ID>/<module_name>/<module_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 ZIP file.

    • The request URL contains the registry URL, the Go module name and version, and the file name in the registry. For example:

      https://registry.yandexcloud.net/go/cn15fqbr806r********/mymodule/1.0.0/mymodule-v1.0.0.zip
      

    Warning

    In the URL, provide the Go module version without the v prefix; e.g., for version v1.0.0, specify 1.0.0.

    Warning

    When publishing a Go module, do not prefix its name with registry.yandexcloud.net/go/<registry_ID>/. If your Go module's major version is greater than 1, omit the /vN suffix as well; e.g., for a registry.yandexcloud.net/go/<registry_ID>/sample/module/v4 Go module, use sample/module as its name.

Was the article helpful?

Previous
Creating a Go module
Next
Pushing a Go module from the registry
© 2026 Direct Cursus Technology L.L.C.