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 Serverless Containers
  • Comparing with other Yandex Cloud services
    • All guides
    • Getting an IAM token for a service account using a container
      • Creating a container
      • Creating a container revision
    • Viewing operations with service resources
  • Access management
  • Tools
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Creating a container
  3. Creating a container

Creating a container

Written by
Yandex Cloud
Improved by
Danila N.
Updated at July 1, 2026
View in Markdown
Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to create a container.

  2. Navigate to Serverless Containers.

  3. Click Create container.

  4. Enter a name and description for the container. Follow these naming requirements:

    • Length: between 3 and 63 characters.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  5. Click Create.

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

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

To create a container, run this command:

yc serverless container create --name <container_name>

Result:

id: bba3fva6ka5g********
folder_id: b1gqvft7kjk3********
created_at: "2021-07-09T14:49:00.891Z"
name: my-beta-container
url: https://bba3fva6ka5g********.containers.yandexcloud.net/
status: ACTIVE

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.

To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.

To create a container and its revision:

Note

If a registry or repository containing the Docker image is not public, you need to specify in the revision settings a service account with Docker image pull permissions, such as the container-registry.images.puller role for the folder or registry containing the Docker image.

If a service account is specified in the revision settings, the user or service account creating the revision must have the iam.serviceAccounts.user role. This role validates permission to use the service account.

  1. In the configuration file, describe the resources you want to create:

    • name: Container name. This is a required setting. Follow these naming requirements:

      • Length: between 3 and 63 characters.
      • It can only contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    • memory: Amount of memory allocated to the container, in MB. The default value is 128 MB.

    • service_account_id: Service account ID.

    • url: URL of the Docker image in Yandex Container Registry.

    Here is an example of the configuration file structure:

    resource "yandex_serverless_container" "test-container" {
     name               = "<container_name>"
     memory             = <memory_size>
     service_account_id = "<service_account_ID>"
     image {
       url = "<Docker_image_URL>"
     }
    }
    

    For more information about the yandex_serverless_container properties in Terraform, see this provider guide.

  2. Make sure the configuration files are correct.

    1. In the terminal, navigate to the directory where you created your configuration file.

    2. Run a check using this command:

      terraform plan
      

    If the configuration is described correctly, the terminal will display a list of the resources and their settings. Terraform will show any errors in the configuration.

  3. Deploy the cloud resources.

    1. If the configuration is correct, run this command:

      terraform apply
      
    2. To confirm resource creation, type yes and press Enter.

      This will create all the resources you need in the specified folder. You can check the new resources and their settings using the management console or this CLI command:

      yc serverless container list
      

To create a container, use the create REST API method for the Container resource or the ContainerService/Create gRPC API call.

Was the article helpful?

Previous
Revoking roles assigned to a container
Next
Creating a container revision
© 2026 Direct Cursus Technology L.L.C.