🖥️ Hands-On DIY Guide

Build Your Own
Supercomputer
at Home

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.

4Pi Nodes
16CPU Cores
8 GBRAM
100%Open Source
pi@MASTER:~
$ docker node ls
ID           HOSTNAME  STATUS  AVAILABILITY  ROLE
abc123 *  MASTER    Ready   Active        Manager
def456   SLAVE1    Ready   Active        Worker
ghi789   SLAVE2    Ready   Active        Worker
jkl012   SLAVE3    Ready   Active        Worker
$ docker service ls
NAME          REPLICAS  IMAGE
wordpress     4/4       wordpress:latest
mysql         1/1       mysql:latest
portainer     1/1       portainer/portainer
$

What You Will Build

Follow this guide end-to-end and walk away with a fully working private cloud running WordPress — orchestrated across four Raspberry Pi boards.

🔧

Assemble the Hardware

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

Flash & Configure OS

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

Install Docker

Run a single curl command on each Pi to install the Docker Engine and add your user to the docker group.

Install guide →
🌀

Initialise Docker Swarm

Promote your Pi 4 to Swarm Manager, join the three worker nodes, and verify the cluster with docker node ls.

Swarm setup →
🚀

Deploy the Docker Stack

Use a docker-compose.yml to deploy WordPress + MySQL + Portainer + phpMyAdmin across the cluster in Ingress SWARM mode.

Deploy guide →
📊

Measure Performance

Deploy NetData to all four nodes and visualise CPU, memory, network and Docker container metrics in real time.

Performance guide →

Step-by-Step Roadmap

Every step links directly to the full guide page. Work through them in order.

Why Docker Swarm?

Docker Swarm turns multiple Raspberry Pi boards into a single logical host, automatically distributing containers across nodes.

📦

Containers

Each app (WordPress, MySQL, phpMyAdmin) runs in its own isolated container — lightweight, portable and repeatable.

🔁

Ingress Load Balancing

Swarm mode automatically routes incoming requests to any available container replica, giving you built-in high availability.

🖥️

Portainer GUI

Manage the entire cluster — stacks, services, networks, volumes and images — through a clean browser-based interface.

📡

Overlay Networking

Docker creates an encrypted overlay network across all four nodes so services communicate as if on the same machine.

docker-compose.yml — Deploy WordPress on the cluster
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

Real-Time Performance Measurement

Deploy NetData to all four nodes and monitor CPU, RAM, network throughput and Docker container health from a unified dashboard.

~750 MHz
Pi 3 B+ CPU clock
1.5 GHz
Pi 4 CPU clock
35 KB
Desktop RAM footprint
19999 port
NetData dashboard
netdata docker-compose.yml
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
⚠️
Important: Do not install a conventional Linux firewall (iptables/ufw) on a Docker host. Docker uses Netfilter iptables internally and the two will conflict, potentially destroying your Docker installation.

+35 Years in IT

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.

🚴 Long-Distance Cycling

  • 2019 Denmark → Varna / Black Sea  2,900 km
  • 2020 Denmark → Athens / Greece  2,950 km
  • 2021 Denmark → Varna / Black Sea  2,750 km
Get in Touch LinkedIn →