← All notes

Docker Swarm secrets: share sensitive data with running services

Answer: Docker secrets let swarm services use sensitive data without storing it in an image or in source control.

What a secret is for

Secrets are encrypted during transit and at rest in a Docker swarm.

Only services granted explicit access can read a given secret, and only while their tasks are running.

Typical secret data includes passwords, TLS certificates, SSH keys, and other sensitive strings or binary content up to 500 kb.

Docker secrets are only available to swarm services, not to standalone containers.

How secrets show up in a task

You can also use secrets to manage non-sensitive data, such as configuration files.

For that non-sensitive material, Docker supports the use of configs.

The secret is stored in the Raft log, which is encrypted.

Secrets are explicitly removed when a container stops.

See also

Claims

Sources

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

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Manage sensitive data with Docker secrets; Docker, Inc., Manage sensitive data with Docker secrets (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:znq3jkej

iinventedlight. 2026. "Docker Swarm secrets: share sensitive data with running services." iinventedlight Library, iil:note:znq3jkej, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-swarm-secrets/. License: CC-BY-4.0.

@misc{iil_note_znq3jkej,
  author = {{iinventedlight}},
  title = {{Docker Swarm secrets: share sensitive data with running services}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/docker-swarm-secrets/},
  note = {Permanent ID iil:note:znq3jkej. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-swarm-secrets.md.