---
title: "Generate a token in Container Registry"
sidebar_label: "Generate a token"
sidebar_position: 1
description: "How to generate a token"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'

# Generate a token in Container Registry

<Tabs queryString="generate-token">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    To configure access to registries, generate a token. You can select the token expiration date, access rights, and registries to which the token gives access.

    1. In the [control panel](https://my.selectel.ru/vpc/default/craas/), on the top menu, click **Products** and select **Container Registry**.

    2. Open the **Tokens** tab.

    3. Click **Generate Token**.

    4. Enter the token name.

    5. Select access rights:

       * read-only — downloading images and charts from the registry will be available;
       * write and read — adding, downloading, and deleting images and charts from the registry will be available.

    6. Select the registry you want to grant access to. If you grant access to all registries, the token will also be valid for new registries you create in this project.

    7. Select the token validity period:

       * 30 days;
       * 60 days;
       * 90 days;
       * 1 year;
       * indefinite.

    8. Click **Generate Token**.

    9. Save the authorization data using the token — copy the username (username) and password (password) or download the token in `.json` format.
  </TabItem>

  <TabItem value="terraform">
    <TabItemLabel>
      Terraform
    </TabItemLabel>

    Use the [Create a Container Registry and an authorization token](/terraform/examples/craas/create-registry-and-token/) guide in the Terraform documentation.
  </TabItem>
</Tabs>

<Formbricks />
