unauthorized: authentication required

Docker registry authentication failed because no valid credentials were sent, so you need to log in or fix the token used for that registry.

unauthorized: authentication required

Fix it fast

Most likely: Docker did not send valid credentials for the exact registry host in the image reference.

Confirm this is your error

Match the output and confirm you are troubleshooting the same failure.

unauthorized: authentication required

What Access Failed

This is usually a target-and-identity problem, not a syntax problem. The request made it to the server, but the server did not like the credentials, permissions, or repository path attached to it.

Fix credentials and target access

Login to the exact registry host shown in the image reference:docker login <registry>

If this happens in CI, print the registry host and confirm the secret variables are present before the login step.

If you use a cloud registry, fetch a fresh short-lived token and retry the login.

If credentials are stored locally, run docker logout <registry> and then log in again so Docker refreshes the stored credential.

Manual authentication checks

Print the exact registry host from the image reference.

Check ~/.docker/config.json and confirm the host is covered by either auths or your configured credential helper.

If CI is involved, confirm the login step actually ran before the failing pull or push.

Why It Happens

Usually this comes down to you are not logged in to the target registry host, CI did not inject the expected token or password into docker login, or the credential helper is not returning credentials for the registry you are talking to.

Prove the Failing Environment Can Reach It

Retry the pull or push and confirm the registry no longer returns authentication required, and run a simple authenticated operation against the same registry and repository path.

How registry authentication works

Docker sends registry credentials based on the registry host in the image reference. If no valid credentials are available for that host, the registry rejects the request before Docker can read manifests or layers.

Keep Credentials and Targets Aligned

To prevent this, keep registry hostnames explicit in scripts instead of relying on ambiguous defaults, use automation tokens for CI and rotate them regularly, and document which credential helper or secret source each environment uses.

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list

Product updates, new tools, and practical guides from RepoFlow.