DOCKER HUB ACCOUNT GUIDE

How to enable 2FA on Docker Hub

Two-factor authentication protects your personal Docker account, including Docker Hub. Start with a verified email address and your account password, and keep the single recovery code safe.

Open Docker account settings

  1. Sign in to Docker, open your avatar, and choose Account settings → 2FA.
  2. Confirm your password.
  3. Copy, download, or print the recovery code before continuing. Store it securely outside your phone.

Add Docker to Sign In

You can use Sign In, our authenticator app for codes on your iPhone.

  1. With the setup QR code on another screen, open Sign In and tap Add → Scan QR Code.
  2. Scan the code, review the account details, and tap Add Account.
  3. Enter the current six-digit code in Docker’s Authentication code field, then select Enable 2FA.

Open Docker’s Text Code tab for manual setup, or use the QR Code tab for scanning. In Sign In, choose Add → Enter Setup Key, set Service to Docker and Account to your account name, paste the secret into Key, then tap Add Account. Keep this key private.

If your authenticator is unavailable

After entering your password, choose I’ve lost my authentication device, enter your recovery code, and select Verify.

This consumes the recovery code and turns off 2FA. Enroll your replacement as soon as access is restored and save its new recovery code. If you lose both the authenticator and recovery code, contact Docker Support.

While you still have access, Generate new code in the 2FA settings replaces a lost recovery code.

Command-line and automation access

Use a personal access token for Docker CLI, scripts, or CI that need a credential after 2FA is enabled. Follow Docker’s token documentation and grant only the permissions the workflow needs.

Organization SSO is managed separately from these personal account settings.

If a code does not work

Make sure the Docker entry in Sign In matches the account you are using. Wait for a fresh code, then enter it before it changes. If fresh codes keep failing, check that your iPhone uses automatic date and time.

Keep a working sign-in session and your recovery information available while resolving the problem. Adding an entry to Sign In does not finish enrollment: the service must accept a code and confirm activation.

Official help