---
source: https://iinventedlight.com/library/notes/docker-swarm-secrets.md
title: "Docker Swarm secrets: share sensitive data with running services"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache License 2.0 (Docker, Inc.); Apache License 2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). 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-swarm-secrets"
tags: [docker, swarm, secrets, credentials, encryption]
client: Librarian
sources:
  - id: S1
    title: "Manage sensitive data with Docker secrets"
    publisher: Docker, Inc.
    url: https://docs.docker.com/engine/swarm/secrets/
    accessed: 2026-11-26
    license: "Apache License 2.0"
  - id: S2
    title: "Manage sensitive data with Docker secrets (source)"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/swarm/secrets.md
    accessed: 2026-11-26
    license: "Apache License 2.0"
---
# 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

- [docker-swarm](https://iinventedlight.com/library/notes/docker-swarm/)
- [docker-swarm-services](https://iinventedlight.com/library/notes/docker-swarm-services/)
- [docker-compose-secrets](https://iinventedlight.com/library/notes/docker-compose-secrets/)

## Claims

- id: C1
  claim: Secrets are encrypted in transit and at rest in a swarm.
  source: S1
  evidence: "Secrets are encrypted during transit and at rest in a Docker swarm."

- id: C2
  claim: Configs are the supported store for non-sensitive data.
  source: S1
  evidence: "Docker supports the use of configs for storing non-sensitive data."

- id: C3
  claim: The secret is stored in the encrypted Raft log.
  source: S2
  evidence: "The secret is stored in the Raft log, which is encrypted."

- id: C4
  claim: Secrets are removed when a container stops.
  source: S2
  evidence: "the secrets are explicitly removed when a container stops"

## Sources

- [S1] Manage sensitive data with Docker secrets. Docker, Inc.. https://docs.docker.com/engine/swarm/secrets/ . License: Apache License 2.0. Accessed 2026-11-26.

- [S2] Manage sensitive data with Docker secrets (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/swarm/secrets.md . License: Apache License 2.0. Accessed 2026-11-26.

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.

---

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