ProjectStack
docker

Error response from daemon: unauthorized: authentication required

You're trying to pull from or push to a registry that requires authentication, but you're not logged in. The registry rejected the request because it couldn't verify your identity. This happens with private Docker Hub repos, GitHub Container Registry, AWS ECR, and other protected registries.

Common causes

  • You haven't run docker login for the registry you're accessing
  • Your login session expired — Docker credentials in ~/.docker/config.json are stale
  • You're logged in to Docker Hub but the image is on a different registry
  • CI/CD pipeline doesn't have the registry credentials configured

How to fix it

  1. Log in to Docker Hub: docker login with your username and password (or Personal Access Token)
  2. Log in to a specific registry: docker login registry.example.com
  3. For GitHub Container Registry: docker login ghcr.io -u USERNAME --password-stdin <<< TOKEN
  4. In CI/CD, use environment variables for credentials: echo $REGISTRY_TOKEN | docker login -u $REGISTRY_USER --password-stdin

Example

$ docker pull registry.example.com/myapp:latest Error response from daemon: unauthorized: authentication required

Pulling from a private registry without having logged in first

Browse more errors

The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.