Skip to content
Latchkey

Docker "denied: requested access to the resource is denied" on Push

You are authenticated, but the account behind those credentials is not allowed to push to this specific repository. This is an authorization failure, not an authentication one.

What this error means

A docker push reaches the registry, the login succeeded, but the push is rejected with denied: requested access to the resource is denied. The same image pulls fine; only the write is blocked.

docker push output
The push refers to repository [docker.io/otherorg/api]
denied: requested access to the resource is denied

Diagnose it: separate auth from naming from rate limits

Registry errors look alike and have unrelated causes. Work out which of the three you have before changing credentials, because a malformed image reference produces an error that reads like an authentication failure.

Terminal
# 1. is the reference even valid? (lowercase, no spaces, valid tag)
docker image inspect "$IMAGE" 2>&1 | head -2

# 2. are you authenticated to the right registry?
cat ~/.docker/config.json | grep -o '"[^"]*\.[^"]*"' | head

# 3. are you rate limited? (Docker Hub anonymous pulls)
curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimit-preview/test:pull" \
  | grep -o '"token"' >/dev/null && echo "token ok"

Common causes

Pushing to a namespace you do not own

The image is tagged for a repository under an account or org your credentials cannot write to - e.g. tagged otherorg/api while logged in as myorg. Docker Hub also rejects pushes to library/*.

The repository does not exist and auto-create is off

Some registries (and org policies) require the repository to be created first. Pushing to a non-existent repo under a namespace you do control still returns denied if auto-creation is disabled.

Token has read but not write permission

A read-only access token authenticates successfully but cannot push, producing a denial only on write operations.

How to fix it

Tag for a repository you can write to

Make the tag match the authenticated account or org namespace.

Terminal
# tag under the namespace you own
docker tag api:latest docker.io/myorg/api:1.4.2
docker push docker.io/myorg/api:1.4.2

Create the repository or enable auto-create

  1. For ECR, create the repository (or set createRepositoryOnPush).
  2. For GHCR/Docker Hub orgs, confirm the package/repo exists and the actor has write access.
  3. Use a token/role with push permission, not read-only.

Authenticate in the job, not in the image

.github/workflows/ci.yml
- uses: docker/login-action@v3
  with:
    registry: ghcr.io
    username: ${{ github.actor }}
    password: ${{ secrets.GITHUB_TOKEN }}

# GHCR needs this on the job or the push is rejected as unauthorised
permissions:
  contents: read
  packages: write

How to prevent it

  • Keep image tags aligned with the namespace your CI credentials own.
  • Pre-create registry repositories as part of infrastructure, or enable auto-create.
  • Audit token scopes so CI push credentials always include write.

Frequently asked questions

What causes Docker "denied: requested access to the resource is denied" on push?
There are 3 common causes: pushing to a namespace you do not own, the repository does not exist and auto-create is off, and token has read but not write permission. The image is tagged for a repository under an account or org your credentials cannot write to - e.g.
How do I fix Docker "denied: requested access to the resource is denied" on push?
There are 2 fixes depending on which cause you have: tag for a repository you can write to and create the repository or enable auto-create. Work through them in order, since the first is the most common.
What does Docker "denied: requested access to the resource is denied" on push actually mean?
A docker push reaches the registry, the login succeeded, but the push is rejected with denied: requested access to the resource is denied.
How do I stop Docker "denied: requested access to the resource is denied" on push happening again?
Keep image tags aligned with the namespace your CI credentials own. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

This is a registry failure, not a bug in your code. Latchkey detects, repairs, and retries it for you. Start free → 30-day trial · No credit card