incorrect username or password 🐳 Docker

Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

docker login was rejected — wrong credentials, or the account requires an access token instead of the password.

Seen on: Docker

Meaning

Docker Hub accounts with 2FA (and all SSO accounts) need a personal access token as the password. Logging in with an email instead of the username also fails.

Common causes

  • Using the password on an account with 2FA/SSO
  • Email used instead of Docker ID username
  • Expired/revoked access token
  • Special characters mangled by the shell

⚡ Quick fix

  1. Create a personal access token and use it as the password
  2. Log in with the username, not the email
  3. Use --password-stdin to avoid shell quoting

Detailed fix by platform

Docker

  1. echo "$DOCKERHUB_TOKEN" | docker login -u myusername --password-stdin

How to diagnose

  1. Username — Docker ID, not email
  2. 2FA — Enabled on the account?
  3. Token — Still valid?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.