How do I create and manage access tokens?
Every push and pull needs a token. Each token works for one registry only and is either:
- Read only (pull): for servers, clusters and anything that only downloads images.
- Read and write (push and pull): for your CI or your own computer.
A token has a user name, which starts with robot$, and a token (the password).
Create a token
Section titled “Create a token”- Open your registry’s page and the Access tokens tab.
- Name: a label that tells you where it’s used, such as CI pipeline.
- Access: Read only (pull) or Read and write (push and pull).
- Expires: in 30 days, in 90 days, in 1 year, or never.
- Click Create token.
- Copy the user name and the token now. The token is shown only once. Then click I saved it.
If you lose a token, create a new one and delete the old one.
The Primary token
Section titled “The Primary token”A new registry comes with a Primary token that can push and pull and never expires. Click Show token (once) to see it. That button works once, and only within 7 days of creating the registry.
Revoke a token
Section titled “Revoke a token”On the Access tokens tab, click Delete next to the token and confirm. It stops working at once: anything using it can no longer push or pull. Your other tokens keep working.
Good to know
Section titled “Good to know”- The tab shows each token’s name, user name, access, and when it expires.
- Your plan sets how many tokens a registry can have; the tab shows how many you use. To create another one when you’re at the limit, delete one first, or move to a bigger plan.
- Use read-only tokens wherever you can. If a read-only token leaks, nobody can change your images with it.
- When a registry is suspended or cancelled, all its tokens are switched off. See How do I change my registry plan or cancel it?
- Keep tokens out of your code. Store them as secrets in your CI, or in a file only you can read.
Was this helpful?
Thank you. If something is missing, tell us.
