Docker swarm PKI: mutual TLS, a root CA, and join tokens
Answer: Docker Swarm mode includes a public key infrastructure system so nodes can authenticate, authorize, and encrypt traffic to one another with mutual TLS.
The built-in CA
Running docker swarm init creates the swarm and makes the current engine a manager.
By default, the manager generates a new root Certificate Authority and a key pair used to secure communications with joining nodes.
The --external-ca flag of docker swarm init lets you specify your own externally-generated root CA.
Join tokens
The manager also issues two join tokens, one for workers and one for managers.
Each token carries a digest of the root CA certificate plus a randomly generated secret.
The joining node uses the digest to check the manager's CA certificate, and the manager uses the secret to confirm the joiner is approved.
See also
Claims
- id: C1 claim: docker swarm init makes the current node a manager. source: S1 evidence: "Docker designates itself as a manager node."
- id: C2 claim: An external root CA can be passed with --external-ca. source: S1 evidence: "using the --external-ca flag of the docker swarm init command."
- id: C3 claim: The manager generates a worker token and a manager token. source: S2 evidence: "one worker token and one manager token."
Sources
- [S1] Manage swarm security with public key infrastructure (PKI). Docker, Inc.. https://docs.docker.com/engine/swarm/how-swarm-mode-works/pki/ . License: Apache License 2.0. Accessed 2026-11-26.
- [S2] Manage swarm security with public key infrastructure (PKI) (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/swarm/how-swarm-mode-works/pki.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 swarm security with public key infrastructure (PKI); Docker, Inc., Manage swarm security with public key infrastructure (PKI) (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 swarm security with public key infrastructure (PKI); Docker, Inc., Manage swarm security with public key infrastructure (PKI) (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker swarm PKI: mutual TLS, a root CA, and join tokens." iinventedlight Library, iil:note:vrnaq9sf, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-swarm-pki/. License: CC-BY-4.0.
@misc{iil_note_vrnaq9sf,
author = {{iinventedlight}},
title = {{Docker swarm PKI: mutual TLS, a root CA, and join tokens}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/docker-swarm-pki/},
note = {Permanent ID iil:note:vrnaq9sf. License: CC-BY-4.0.},
}
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.
- docker-swarm-pki.schema.json (schema; CC-BY-4.0)
- docker-swarm-pki.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-swarm-pki.md.