content/manuals/security/access-tokens.md
Personal access tokens (PATs) provide a secure alternative to passwords for Docker CLI authentication. Use PATs to authenticate automated systems, CI/CD pipelines, and development tools without exposing your Docker Hub password.
PATs offer significant security advantages over password authentication:
Use PATs for these common scenarios:
[!NOTE]
For organization-wide automation, consider organization access tokens which aren't tied to individual user accounts.
[!IMPORTANT]
Treat access tokens like passwords and keep them secure. Store tokens in credential managers and never commit them to source code repositories.
To create a personal access token:
Sign in to the Docker CLI using your personal access token:
$ docker login --username <YOUR_USERNAME>
Password: [paste your PAT here]
When prompted for a password, enter your personal access token instead of your Docker Hub password.
[!NOTE]
You can't edit the expiration date on an existing personal access token. You must create a new PAT if you need to set a new expiration date.
You can rename, activate, deactivate, or delete a token as needed. You can manage your tokens in your account settings.
Docker Desktop automatically creates authentication tokens when you sign in, with these characteristics:
You can manually delete auto-generated tokens if needed, but they'll be recreated when you use Docker Desktop.
When using personal access tokens, be aware that excessive token creation may result in throttling or additional charges. Docker reserves the right to impose restrictions on accounts with excessive PAT usage to ensure fair resource allocation and maintain service quality.
Best practices for fair use include: