Skip to main content

Docker authentication

Quick guide to authenticating Docker with GitHub Container Registry.

1. Create a personal access token (PAT)

  1. Go to GitHub Developer Settings > Personal access tokens > Tokens (classic).
  2. Generate a new token (classic).
  3. You can name this token "Docker CLI" for future reference.
  4. Select the read:packages scope (minimum required to pull images).
  5. Copy the PAT token.

2. Authenticate

Run the following command in your terminal to log in:

docker login ghcr.io

Use your GitHub username. Use your PAT as the password.

3. Verify

If successful, you will see: Login Succeeded