Yandex Cloud
Search
Contact UsTry 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 Container Registry
  • Getting started
    • All guides
    • Installing and configuring Docker
    • Authentication in Container Registry
      • Getting information about existing repositories
      • Creating a repository
    • Scanning Docker images for vulnerabilities
    • Creating a trigger for a registry
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Troubleshooting
  • FAQ
  1. Step-by-step guides
  2. Managing a repository
  3. Creating a repository

Creating a repository

Written by
Yandex Cloud
Updated at April 28, 2026

Note

A repository will only be displayed after you push a Docker image to it.

To create a repository:

Terraform
API

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. Describe the parameters of the yandex_container_repository resource in the configuration file:

    resource "yandex_container_registry" "my-registry" {
      name = "test-registry"
    }
    
    resource "yandex_container_repository" "my-repository" {
      name = "${yandex_container_registry.my-registry.id}/<repository_name>"
    }
    
    output "my-registry-id" {
      value = yandex_container_registry.my-registry.id
    }
    
    output "my-repository-name" {
      value = yandex_container_repository.my-repository.name
    }
    

    Where name is the repository name in <registry_ID>/<repository_name> format. You can retrieve registry ID from the folder registry list.

    For more information about the resources you can create with Terraform, see the provider documentation.

  2. Create resources:

    1. In the terminal, navigate to the configuration file directory.

    2. Make sure the configuration is correct using this command:

      terraform validate
      

      If the configuration is valid, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    Terraform will create all the required resources. You can check the new resources using the management console or this CLI command:

    yc container repository list --registry-id <registry_ID>
    

To create a repository, use the upsert REST API method for the Repository resource or the RepositoryService/Upsert gRPC API call.

Was the article helpful?

Previous
Getting information about existing repositories
Next
Getting information about existing lifecycle policies
© 2026 Direct Cursus Technology L.L.C.