docker push is denied: requested access to the resource is denied
denied: requested access to the resource is deniedShort answer
The registry refused the push. Most often the image is tagged without your Docker Hub namespace, so Docker tries to push to a repository you do not own. Tag it as namespace/name:tag, make sure docker login succeeded for that account, and check the account has write access.
Fix it fast
1Find out which cause you have
Look at the full name of the image you are pushing. The part before the first slash is the namespace.
docker image ls2Match what you see, then jump to its fix
- 1
The image is listed as just myapp, or with a namespace that is not your accountThe image has no namespace of yours in its nameFix - 2
The namespace is right, but the push is refused straight awayYou are not logged in, or logged in as another accountFix - 3
Pull works, push is denied on an organization repositoryThe account can read the repository but not write to itFix
- 1
What does the error look like?
denied: requested access to the resource is deniedpush access denied, repository does not exist or may require authorization
Cause 1 of 3
The image has no namespace of yours in its name
1Check
A bare name resolves to the library namespace, which is reserved for Docker Official Images, so a push there is refused.
docker image ls myapp2Fix
Add your account or organization name as the namespace by tagging again, then push the new name.
docker image tag myapp <your-namespace>/myapp:1.0
docker image push <your-namespace>/myapp:1.03Verify
The push finishes with a digest.
docker image push <your-namespace>/myapp:1.0Confirmed by docs.docker.com
Cause 2 of 3
You are not logged in, or logged in as another account
1Check
docker login authenticates to the registry named in its SERVER argument. A login to one registry does not apply to another host.
cat ~/.docker/config.json2Fix
Log out and in again with the right account. For a registry that is not Docker Hub, include its host.
docker logout
docker login3Verify
Login succeeds and the push is accepted.
docker image push <your-namespace>/myapp:1.0Confirmed by docs.docker.com
Cause 3 of 3
The account can read the repository but not write to it
1Check
Access to organization repositories comes from member roles, teams and their permissions.
docker pull <org>/myapp:1.02Fix
Ask an organization owner to give your team write permission on that repository, or push to a repository you own.
docker image tag myapp <your-namespace>/myapp:1.03Verify
Push again after the permission change.
docker image push <your-namespace>/myapp:1.0Confirmed by docs.docker.com
How do I stop it coming back?
- Put the full registry path in your build tag from the start, using one variable for the namespace.
- In CI use an access token with write scope, stored as a secret.
- Test docker login before the build step so a credential problem fails fast.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
docker pull says access denied or repository does not exist
Error response from daemon: pull access denied for <image>
Docker prints this when it cannot find the image under that name with your current credentials.
3 causes, each with a fixServers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
AH00558: Apache in Docker cannot reliably determine its fully qualified domain name
Set the 'ServerName' directive globally to suppress this message
AH00558 is a warning, not a crash.
2 causes, each with a fixServers
Apache in a Docker container logs AH01114 when it proxies to a backend
AH01114: HTTP: failed to make connection to backend: api
Apache's proxy worker could not open a connection to the address in ProxyPass.
5 causes, each with a fix