> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/containers/private-container-registry/dcd-how-tos/manage-a-token.md).

# Manage a Token

Tokens manage access to your Private Container Registry effectively and efficiently. Tokens serve as secure authentication methods, eliminating the need for personal credentials to be used during Continuous Integration and Continuous Deployment (CI/CD) processes. Personal credential management can become cumbersome and impractical as your services and deployments expand. Tokens provide a scalable solution for access control.

In order to minimize the permissions given to each token, you can also use:

* **Scopes** to limit token access as narrowly as possible to specific resources and the actions it is permitted to perform on those resources to enhance security during artifact deployment. Each token can link to an individual or service, simplifying the audit process and strengthening the ability to monitor Private Container Registry activity.
* **Expiration dates** to ensure that the permissions of tokens can be automatically revoked after a period of time.
* **Distinct tokens for each environment** to ensure access appropriately aligns with each environment's requirements and your security policies.

## Create a Token

1\. In the **DCD**, go to **Menu** > **Containers** > **Container Registry**.

2\. Select a Private Container Registry in the **Container Registry** window to configure its tokens.

![Select a Running Private Container Registry](/files/3NCI65Gg1fLytktCUdNo)

3\. Select **Tokens** tab > **Add Token**. You can also select the **OPTIONS** menu > ![Options menu](/files/zMw81MF9KCPxOHBMLSog) > **Tokens**.

4\. Provide the following details in the **Tokens** tab:

* **Name:** Enter a **Name** for the token.

{% hint style="info" %}
**Notes:** You cannot change the token **name** later. The token **name** must:

* Contain only alphanumeric characters and dashes.

* Be between 3 and 63 characters in length.

* Begin with an character between a-z.

* End with an alphanumeric character.
  {% endhint %}

* **State:** Turn on the toggle button to enable the status. The token can be disabled later.

* **Expiry Date:** Select **Expire on (minimum 1 hour)** to enter an expiry date. Otherwise, select **No expiry**.

{% hint style="info" %}
**Note:** The **Expiry Date** must be at least one hour in the future. When the **Expiry Date** is reached, the token is deleted, it is not disabled.
{% endhint %}

* **Scope:** Define all actions the token has permission to perform and on which repositories. Provide the following details:
* **Type:** Select either of the following types:
  * **Repository:** Select it to manage the contents of the repository.
  * **Registry:** Select it to create a token to get the list of repositories in the Private Container Registry.
* **Path:** Enter the names of repositories to which the token will have access. You can use `*` as a wildcard to provide access to all repositories.
* **Actions:** Select the one or more of the following **Actions** for the token:
  * **Admin:** Select **Admin** to allow the token to delete artifacts from the repository.
  * **Push:** Select **Push** to allow the token to push new artifacts to the repository. When choosing **Push**, you must also set the **Pull** action for the token.
  * **Pull:** Select **Pull** to allow the token to be able to pull artifacts from the repository.

{% hint style="info" %}
**Note:** You can set a single scope when you add a token; however, further scopes can be added later at any time. For more information, see [<mark style="color:blue;">Adding scopes to a token</mark>](#adding-scopes-to-a-token).
{% endhint %}

5\. Select **Add Token**.

![Provide the necessary information and create the token](/files/Uuc5U0tNwUcHOjbxZ4LJ)

{% hint style="success" %}
**Result:** You will get the Docker Login command using the newly created token along with all the details of the newly created credential.
{% endhint %}

![Your are presented with important token credentials](/files/BFzp7O2LLz0qZigckoOt)

{% hint style="info" %}
**Note:** You will only have access to this token's password at this time. We recommend that you save the token safely and securely because the password cannot be recovered.
{% endhint %}

## Edit a Token

1\. In the **DCD**, go to **Menu** > **Containers** > **Container Registry**.

2\. Select a Private Container Registry in the **Container Registry** window to modify its token.

![Select a Running Private Container Registry](/files/3NCI65Gg1fLytktCUdNo)

3\. Select the **Tokens** tab.

4\. Identify the token you want to edit and select the **OPTIONS** menu ![Options menu](/files/zMw81MF9KCPxOHBMLSog) > **Edit**.

![Edit token](/files/883Ng5JSa4tntGoSAOyP)

5\. Update the **State** and **Expiry Date** (if required) and select **Save**.

## Adding scopes to a token

1\. In the **DCD**, go to **Menu** > **Containers** > **Container Registry**.

2\. Select a Private Container Registry in the **Container Registry** window to add scopes to its tokens.

3\. Navigate to the **Tokens** tab.

4\. Select a token and select the **OPTIONS** menu ![Options menu](/files/zMw81MF9KCPxOHBMLSog) > **Manage Scope**.

![Navigate to Tokens section](/files/YPuMB33nGlnrzHy0D9pV)

5\. Complete the following fields:

* **Type** Select either of the following types:
  * **Repository:** Select it to manage the contents of the repository.
  * **Registry:** Select it to create a token to get the list of repositories in the Private Container Registry.
* **Path:** Enter the names of repositories to which the token will have access. Use `*` as a wildcard to provide access to all repositories.
* **Actions:** Select the one or more of the following **Action** for the token:
  * **Admin:** Select **Admin** if you want to allow the token to delete artifacts from the repository.
  * **Push:** Select **Push** if you want the token to push new artifacts to the repository. When choosing **Push**, you must also set the **Pull** action for the token.
  * **Pull:** Select **Pull** if you want this token to be able to pull artifacts from the repository.

6\. Click **Add Scope**.

![Add Scope](/files/1hfnyP8Oq4A5QkOnBe2K)

7\. Repeat steps **5** and **6** to associate additional scopes.

8\. Click **X** at the top-right corner to close the window.

## Remove scopes from a token

1\. In the **DCD**, go to **Menu** > **Containers** > **Container Registry**.

2\. Select a Private Container Registry in the **Container Registry** window to remove scopes from its tokens.

3\. Select the **Tokens** tab.

4\. Select a token and select the **OPTIONS** menu ![Options menu](/files/zMw81MF9KCPxOHBMLSog) > **Manage Scope**.

5\. Identify the scope that is not required and click **Remove** or use **Remove all** to remove all the associated scopes.

![Remove scope](/files/sDtS36qJFIJOnpH7lJ9G)

6\. Click **X** at the top-right corner to close the window.

## Delete a token

1\. In the **DCD**, go to **Menu** > **Containers** > **Container Registry**.

2.Select a Private Container Registry in the **Container Registry** window to delete a token associated with it.

3\. Select the **Tokens** tab.

4\. Select a token and select the **OPTIONS** menu ![Options menu](/files/zMw81MF9KCPxOHBMLSog) > **Delete**.

![Navigate to Tokens section](/files/YrWGZ2mphyTt8SltGUDv)

5\. Select **Delete Token** to confirm the deletion. This action is irreversible.

![Confirm Token Deletion](/files/m3sNJvixz8ThHhK8PZXN)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/containers/private-container-registry/dcd-how-tos/manage-a-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
