---
source: https://iinventedlight.com/library/notes/docker-login.md
title: "docker login: authenticate to a registry"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (docker/cli); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker login; docker/cli, docker login reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-login"
tags: [docker, login, registry, cli]
client: Librarian
sources:
  - id: S1
    title: "docker login"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/cli/docker/login/
    accessed: 2026-11-23
    license: "Apache-2.0"
  - id: S2
    title: "docker login reference"
    publisher: docker/cli
    url: https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/login.md
    accessed: 2026-11-23
    license: "Apache-2.0"
---
# docker login: authenticate to a registry
**Answer:** docker login authenticates you to a container registry. If no server is specified, the command defaults to Docker Hub. Credentials land in a configured credential store.

## When login is required

The command's purpose is to authenticate to a registry.

Any public or private registry for which you have credentials can be a target.

Pulling and pushing images are operations that may require authentication.

## Defaults and flags from the CLI docs

If no server is specified, the tool defaults to Docker Hub.

The CLI accepts --username and --password, and --password-stdin reads a password or access token from stdin.

Those authentication credentials are stored in the configured credential store.

## See also

- [docker-tag](https://iinventedlight.com/library/notes/docker-tag/)
- [docker-build-context](https://iinventedlight.com/library/notes/docker-build-context/)

## Claims

- id: C1
  claim: docker login authenticates to a registry.
  source: S1
  evidence: "Authenticate to a registry"

- id: C2
  claim: Authentication may be required for pulling and pushing images.
  source: S1
  evidence: "required for pulling and pushing images"

- id: C3
  claim: With no server argument, login defaults to Docker Hub.
  source: S2
  evidence: "Defaults to Docker Hub if no server is specified"

- id: C4
  claim: You can read a password or access token from stdin.
  source: S2
  evidence: "Read password or access token from stdin"

## Sources

- [S1] docker login. Docker Docs. https://docs.docker.com/reference/cli/docker/login/ . License: Apache-2.0. Accessed 2026-11-23.

- [S2] docker login reference. docker/cli. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/login.md . License: Apache-2.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker login; docker/cli, docker login reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
