keepcalculator

06 Numbers and Powers

Docker on Raspberry Pi: What I Run and How

Card No. 06·28327 · Updated · Standard formula, shown below

Total RAM needed 1,280 MB
RAM per core
320.0 MB
Result
Container count
5 containers
You entered
Average RAM per container
256 MB
You entered
You enter
Container count, Average RAM per container, CPU cores available
You get
Total RAM needed, RAM per core
Rounding
0 dp · 1 dp

If you’re wondering what you can actually run on a Raspberry Pi with Docker, the short answer is: a surprising amount—from lightweight web servers and databases to home automation, media streaming, and network tools—as long as you choose ARM-compatible images and keep resource expectations realistic. This article explains what Docker on a Pi is good for, what to avoid, and how to get the most out of a small ARM board.

Formula

The calculator above estimates the total memory you need for a given number of containers and the average memory each one uses. The formula is simple:

Total RAM (MB) = Container count × Average RAM per container

It also shows RAM per CPU core, which helps you judge whether your Pi’s processor can keep up:

RAM per core (MB) = (Container count × Average RAM per container) / CPU cores

Variables:

  • Container count – number of Docker containers you plan to run simultaneously.
  • Average RAM per container – typical memory footprint of each container in megabytes (MB).
  • CPU cores – number of CPU cores available on your Raspberry Pi model (e.g., 4 for most modern Pi boards).

This is a planning tool, not a precise measurement—actual usage varies by image and workload.

Worked Example

Using the default values from the calculator:

  • Container count = 5
  • Average RAM per container = 256 MB
  • CPU cores = 4

Step 1: Calculate total RAM:

5 × 256 MB = 1280 MB

Step 2: Calculate RAM per core:

1280 MB / 4 = 320 MB per core

So with 5 containers averaging 256 MB each, you’d need about 1.28 GB of RAM total. A Raspberry Pi 4 with 4 GB or 8 GB would handle that comfortably, while a 2 GB model would be tight.

Why Run Docker on a Raspberry Pi at All?

Docker on a Pi turns a small, low-power board into a tidy server for self-hosted services. Instead of installing software directly on the OS and juggling dependencies, you run each app in its own container. That means:

  • Cleaner updates—pull a new image and restart the container.
  • Isolation—one crashing app doesn’t take down others.
  • Easy experimentation—spin up a service, test it, delete it.
  • Portability—the same Docker Compose file works on a Pi or a cloud server (with ARM images).

For hobbyists and homelab enthusiasts, this is a low-cost way to learn containerization and run always-on services without a big electricity bill.

What People Commonly Run

Here are the categories and specific examples that work well on a Raspberry Pi:

  • Home automation – Home Assistant, Node-RED, or Mosquitto (MQTT broker) to control smart devices.
  • Media servers – Plex or Jellyfin to stream movies and music to your LAN. (Plex requires a Plex Pass for hardware transcoding; without it, direct play works fine.)
  • Web servers – Nginx or Apache for hosting a personal website or reverse proxy.
  • Databases – PostgreSQL, MySQL, or SQLite (via a container) for light data storage.
  • Network tools – Pi-hole for ad-blocking DNS, or WireGuard for a VPN server.
  • Monitoring – Grafana and Prometheus to visualize system metrics.
  • File sharing – Nextcloud for a private cloud, or Samba for simple SMB shares.
  • Development tools – GitLab Runner, Portainer (a web UI for Docker), or VS Code Server.

Most of these have official ARM images or community builds that run fine on a Pi.

What to Avoid and Why

Not everything is suitable. Heavy workloads will quickly exhaust the Pi’s resources:

  • Large databases with many concurrent queries (e.g., a busy production MySQL) will slow to a crawl.
  • Video transcoding on the fly (e.g., Plex converting 4K to 1080p) is CPU-intensive; the Pi’s GPU is not fully supported in Docker for hardware acceleration.
  • Machine learning training or heavy image processing is impractical.
  • Containers that need x86-only images won’t run unless you use emulation (like QEMU), which is slow.

Also avoid running too many containers at once. A Pi 4 with 4 GB RAM can handle maybe 10–15 lightweight containers, but if each one uses 512 MB, you’ll hit memory limits quickly.

How to Choose the Right Raspberry Pi Model

The model matters more than you might think. Here’s a quick guide:

  • Raspberry Pi 5 (8 GB or 16 GB) – best for Docker; more RAM and a faster CPU.
  • Raspberry Pi 4 (2/4/8 GB) – good all-rounder; 4 GB is a sweet spot.
  • Raspberry Pi 3 (1 GB) – very limited; only run 1–2 tiny containers.
  • Raspberry Pi Zero 2 W – not recommended for Docker; too little RAM and CPU.

If you’re buying new, get at least 4 GB of RAM. The 8 GB model gives you headroom for memory-hungry apps like Nextcloud or multiple databases.

Common Problems and How to Fix Them

Here are the typical issues people hit and what to do:

  • “no matching manifest for linux/arm/v7â€� – The image doesn’t have an ARM build. Check if there’s an arm32v7 or arm64v8 tag, or use a different image.
  • Out of memory – The Pi runs out of RAM. Reduce the number of containers, add swap space, or use a model with more RAM.
  • Slow performance – Often due to CPU throttling from heat. Ensure proper cooling (heatsink or fan).
  • SD card corruption – Frequent writes (logs, databases) can wear out SD cards. Use an external SSD via USB for Docker data.
  • Port conflicts – Two containers trying to use the same port. Map different host ports, e.g., 8080:80.

Always check the container logs with docker logs <container_name> to see errors.

Alternatives to Docker on Raspberry Pi

If Docker feels heavy or you hit ARM compatibility issues, consider these:

  • Podman – a daemonless container engine that works with Docker images and runs on ARM.
  • LXC/LXD – system containers that share the host kernel but feel more like VMs.
  • Native installs – Install services directly on Raspberry Pi OS (e.g., apt install nginx). Simpler for a single app, but harder to manage multiple.
  • K3s (lightweight Kubernetes) – if you want orchestration, but it’s overkill for most Pi users.

For most people, Docker is the most convenient and well-documented option.

Frequently Asked Questions

Can I run Docker on a Raspberry Pi 3?

Yes, but with severe limits. The Pi 3 has only 1 GB of RAM, so you can run a few very light containers (like Pi-hole) but nothing memory-hungry. Expect slow performance and consider using a Pi 4 or 5 instead.

Do I need 64-bit OS for Docker on Pi?

Not strictly, but it’s recommended. The 64-bit version of Raspberry Pi OS (or Ubuntu) allows you to run arm64 images, which are more common and often better optimized than 32-bit armv7 images. Many modern images are only published for arm64.

How much RAM do I need for Docker on a Pi?

It depends on what you run. For a few basic services (Pi-hole, Node-RED, a small web server), 2 GB is enough. For heavier apps like Nextcloud or Jellyfin, 4 GB or more is safer. Use the calculator above to estimate.

Can I run x86 Docker images on a Raspberry Pi?

Not directly. Docker images are platform-specific. You can run x86 images using QEMU emulation (e.g., with docker run --platform linux/amd64), but it’s extremely slow and not practical for anything real.

Is it safe to run Docker on an SD card?

It works, but SD cards are prone to corruption from frequent writes. For better reliability, move Docker’s data directory to an external SSD or USB drive. This reduces wear and improves performance.

How do I install Docker on Raspberry Pi?

The easiest way is to use the official convenience script: curl -fsSL https://get.docker.com -o get-docker.sh then sudo sh get-docker.sh. After that, add your user to the docker group with sudo usermod -aG docker $USER and log out/in.

Related

Formula used
in t | Container count | containers | 5 | 1 | 50
in mem | Average RAM per container | MB | 256 | 16 | 4096
in cpu | CPU cores available | cores | 4 | 1 | 8
out total_ram | Total RAM needed | MB | t * mem | 0
out ram_per_core | RAM per core | MB | (t * mem) / cpu | 1

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →