Phase 3 — Deploy & Use · Step 6 of 14

Docker Stack Overview

A Docker Stack is a group of interrelated services that share dependencies and are orchestrated together across a Swarm cluster.

What is a Docker Stack?

A Stack is the top-level unit of Docker Swarm deployment. It groups multiple services together and manages their shared networking and storage.

Our cluster will run a stack called jlar (or any name you choose) containing these services:

ServiceImagePortReplicas
wordpressarm32v7/wordpress8000 → 804
db (MariaDB)jorgenlarsen/mariadb10.3:rpi33061
phpmyadminarm32v7/phpmyadmin8080 → 804
portainerportainer/portainer-ce90001
netdatanetdata/netdata199991 per node

Key Concepts

Services

A service is the definition of how a container should run within Swarm — which image, how many replicas, which ports to expose, which network to join.

Tasks

Each replica of a service is called a task. Swarm scheduler places tasks across available nodes.

Stacks vs Compose

Both use docker-compose.yml files, but they work differently:

docker-composedocker stack deploy
TargetSingle hostMulti-node Swarm
ScalingManualAutomatic across nodes
Deploy keyIgnoredHonoured
Use caseDev / local testingProduction cluster

Step-by-Step with Portainer GUI

After deploying the stack you can explore all its components through Portainer's browser interface:

  • Stacks — list and manage deployed stacks
  • Services — scale replicas, view logs, update images
  • Containers — inspect running container instances per node
  • Networks — visualise overlay and bridge networks
  • Volumes — manage persistent data
  • Images — list locally cached images on each node
  • Swarm — overview of all cluster nodes
💡
The next step covers how to deploy Portainer itself — you need it running before you can use the GUI for the rest of the steps.