← All notes

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

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 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

Permanent ID: iil:note:vrnaq9sf

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.},
}

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-pki.md.