docker stack deploy: roll a Compose file out as a swarm stack
Answer: docker stack deploy rolls a complete application stack onto a swarm from a Compose file.
What the command expects
The engine must already be running in swarm mode.
The deploy command accepts a stack description in the form of a Compose file.
On a local development engine, swarm mode can be turned on with docker swarm init.
You also need a current version of Docker Compose.
Where to run it
On a multi-node swarm, docker stack and docker service commands must be run from a manager node.
The command can create networks and services described by the stack file.
Use docker stack deploy to place your application across the swarm.
Read the Swarm mode key concepts and How services work pages first if the mode is new to you.
See also
Claims
- id: C1 claim: You can use docker stack deploy to deploy a complete application stack to the swarm. source: S1 evidence: "deploy a complete application stack to the swarm"
- id: C2 claim: A local engine can enter swarm mode with docker swarm init. source: S1 evidence: "you can put your engine into Swarm mode with"
- id: C3 claim: The deploy command accepts a stack description in the form of a Compose file. source: S2 evidence: "accepts a stack description in the form of a"
- id: C4 claim: docker stack and docker service commands must be run from a manager node. source: S2 evidence: "commands must be run from a manager"
Sources
- [S1] Deploy a stack to a swarm. Docker, Inc.. https://docs.docker.com/engine/swarm/stack-deploy/ . License: Apache License 2.0. Accessed 2026-11-26.
- [S2] Deploy a stack to a swarm (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/swarm/stack-deploy.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., Deploy a stack to a swarm; Docker, Inc., Deploy a stack to a swarm (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., Deploy a stack to a swarm; Docker, Inc., Deploy a stack to a swarm (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "docker stack deploy: roll a Compose file out as a swarm stack." iinventedlight Library, iil:note:6mwj8qww, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-stack-deploy/. License: CC-BY-4.0.
@misc{iil_note_6mwj8qww,
author = {{iinventedlight}},
title = {{docker stack deploy: roll a Compose file out as a swarm stack}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/docker-stack-deploy/},
note = {Permanent ID iil:note:6mwj8qww. 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-stack-deploy.schema.json (schema; CC-BY-4.0)
- docker-stack-deploy.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-stack-deploy.md.