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 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 22, 2025

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 documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its 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, change to the folder where you edited the configuration file.

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

      terraform validate
      

      If the configuration is correct, the following message is returned:

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

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    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
Yandex project
© 2025 Yandex.Cloud LLC