A complete step-by-step guide to assembling a 4-node Raspberry Pi cluster running Docker Swarm — 16 CPU cores, 8 GB RAM, WordPress, and real-time performance monitoring. No prior cluster experience needed.
Follow this guide end-to-end and walk away with a fully working private cloud running WordPress — orchestrated across four Raspberry Pi boards.
1× Raspberry Pi 4, 3× Pi 3 B+, a 5-port switch, SD cards, power supply, and cables — everything itemised with part numbers.
View parts list →Write Raspberry Pi OS to each SD card, assign hostnames (MASTER / SLAVE1-3), enable VNC, and connect the nodes to your local network.
SD card guide →Run a single curl command on each Pi to install the Docker Engine and add your user to the docker group.
Install guide →Promote your Pi 4 to Swarm Manager, join the three worker nodes, and verify the cluster with docker node ls.
Use a docker-compose.yml to deploy WordPress + MySQL + Portainer + phpMyAdmin across the cluster in Ingress SWARM mode.
Deploy NetData to all four nodes and visualise CPU, memory, network and Docker container metrics in real time.
Performance guide →Every step links directly to the full guide page. Work through them in order.
Docker Swarm turns multiple Raspberry Pi boards into a single logical host, automatically distributing containers across nodes.
Each app (WordPress, MySQL, phpMyAdmin) runs in its own isolated container — lightweight, portable and repeatable.
Swarm mode automatically routes incoming requests to any available container replica, giving you built-in high availability.
Manage the entire cluster — stacks, services, networks, volumes and images — through a clean browser-based interface.
Docker creates an encrypted overlay network across all four nodes so services communicate as if on the same machine.
version: '3'
services:
wordpress:
image: wordpress:latest
ports:
- "80:80"
networks:
- overlay_net
deploy:
replicas: 4
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: yourpassword
MYSQL_DATABASE: wordpress
networks:
- overlay_net
deploy:
replicas: 1
portainer:
image: portainer/portainer
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- overlay_net
deploy:
replicas: 1
placement:
constraints: [node.role == manager]
networks:
overlay_net:
driver: overlay
Deploy NetData to all four nodes and monitor CPU, RAM, network throughput and Docker container health from a unified dashboard.
version: '3'
services:
netdata:
image: netdata/netdata
hostname: example.com # set to fqdn of host
ports:
- 19999:19999
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
With more than 35 years of hands-on experience across hardware development, software engineering, management and sales — I'm always exploring what's next in technology.
This guide grew from a personal project to see just how much computing power you can pack onto a kitchen table with off-the-shelf Raspberry Pi boards.