Invoice Ledger

n8n on a Raspberry Pi or a small mini PC: what actually fits

Three numbers decide it — architecture, RAM and disk writes. Here they are from n8n's own documentation and from the images it publishes, with no benchmark invented.

Guide · image manifests and documentation read on 22 October 2026 · works with JavaScript switched off

The short answer

1. Architecture — the check that saves a wasted evening

An n8n image is a multi-architecture manifest. Asked directly, the registry returns what is inside the tag (this is the measured answer for the version current on 2026-10-22):

n8nio/n8n:2.44.5       linux/amd64, linux/arm64
n8nio/runners:2.44.5   linux/amd64, linux/arm64
postgres:18            linux/amd64, linux/arm64, linux/arm, linux/386, ...

So the whole documented Compose stack — n8n, its task runner, and PostgreSQL 18 — has an arm64 build. A 32-bit (armhf) install has none, and Docker will say something like no matching manifest for linux/arm/v7 rather than run slowly.

On the board, confirm what you have before installing anything:

uname -m        # aarch64 = 64-bit, armv7l = 32-bit
getconf LONG_BIT

If it says armv7l, reinstall with the 64-bit image from Raspberry Pi Imager. The documentation is clear that the 64-bit version is the one for the 3, 4 and 5, and that the Lite edition is the headless one — which is what a server wants.2

2. RAM — the documented number, and what it covers

n8n's Compose page states the requirement as at least 4 GB of RAM and 2 vCPUs, and gives the reason in the same breath: the sandbox that runs AI-generated code (sandbox-runner-1) uses Docker-in-Docker and needs more headroom than a typical container.3

Read that sentence precisely. It is the requirement for that stack — n8n plus the sandbox services plus a bundled search container. It is not a statement that n8n alone needs 4 GB, and this guide will not pretend to know the number for a stripped-down install, because that number was not measured here. What you can do is measure your own box in one command after the first day of real work:

docker stats --no-stream

A board with 4 GB is the smallest thing that matches a documented figure. An 8 GB board or a mini PC with 8–16 GB leaves room for PostgreSQL, the runner and whatever else you keep on the machine. If you are buying hardware for this, buy the RAM, not the CPU .

3. Install — 64-bit OS, Docker, then Compose

3.1 Write the card

Raspberry Pi Imager, Raspberry Pi OS Lite (64-bit), with SSH enabled and a hostname you will recognise. Boot, then update:

sudo apt update && sudo apt full-upgrade -y
sudo reboot

3.2 Install Docker Engine and the Compose plugin

Use Docker's own repository or the convenience script; both are documented by Docker, and n8n's prerequisites point at the same two pages.3 The convenience script is one line and it runs code you have not read — download it first if that bothers you (it should, mildly):

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker "$USER"
newgrp docker
docker compose version

sudo is not optional: Docker's page states the script needs root or sudo privileges, and the login user on a freshly flashed Raspberry Pi OS is not root.9 Docker also labels this convenience script as suitable for testing and development — it is fine here, but read it before you run it, which is why the download and the run are two commands.

3.3 Write compose.yml

This is a reduced version of n8n's own PostgreSQL example: it drops the separate task runner and the sandbox stack, and pins the version instead of tracking latest.4 If you want the external runner — n8n's example includes it, and it has an arm64 build — use their file as written.

services:
  postgres:
    image: postgres:18
    restart: unless-stopped
    environment:
      POSTGRES_USER: n8n
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: n8n
      PGDATA: /var/lib/postgresql/data
    volumes:
      - db_storage:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U n8n -d n8n"]
      interval: 10s
      timeout: 5s
      retries: 5

  n8n:
    image: docker.n8n.io/n8nio/n8n:2.44.5
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_PORT: 5432
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_USER: n8n
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
      N8N_HOST: ${N8N_HOST}
      N8N_PROTOCOL: https
      N8N_WEBHOOK_URL: https://${N8N_HOST}/
      N8N_PROXY_HOPS: "1"
      GENERIC_TIMEZONE: ${GENERIC_TIMEZONE}
      EXECUTIONS_DATA_PRUNE: "true"
      EXECUTIONS_DATA_MAX_AGE: "336"
    volumes:
      - n8n_storage:/home/node/.n8n

volumes:
  db_storage:
  n8n_storage:

Two deliberate choices in that file. The port is bound to 127.0.0.1 so nothing on the network reaches it directly — that one is this guide's choice, not a copy of n8n's example, which publishes 5678:5678 on all interfaces. And N8N_ENCRYPTION_KEY comes from the environment file, which is what n8n's backup documentation requires for a restored database to stay readable.5

The environment file, kept out of version control:

# .env  (chmod 600)
POSTGRES_PASSWORD=<openssl rand -hex 24>
N8N_ENCRYPTION_KEY=<openssl rand -hex 24>
N8N_HOST=n8n.yourdomain.example
GENERIC_TIMEZONE=Etc/UTC

3.4 Start it

docker compose up -d
docker compose ps
docker compose logs -f n8n

Then put a reverse proxy in front of it for TLS. n8n documents three things that break webhooks when they are wrong: the public webhook URL, the number of proxy hops, and the forwarded headers.6 The compose file above already sets N8N_WEBHOOK_URL and N8N_PROXY_HOPS=1 — note that N8N_WEBHOOK_URL replaced the older WEBHOOK_URL, which is deprecated from n8n 2.35.0 and logs a warning if you still use it. Your proxy must then send X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto. Open the editor and create the owner account immediately: until you do, an instance reachable from the network has no owner.

4. The thing that actually kills small installs: execution data

Every execution stores its node output. n8n prunes that automatically: finished executions are deleted after EXECUTIONS_DATA_MAX_AGE hours (default 336, two weeks) or when the count passes EXECUTIONS_DATA_PRUNE_MAX_COUNT (default 10,000), oldest first.7 Two consequences for a board:

The full set of numbers, and how to confirm the database really shrank, is in the execution history guide.

5. Mini PC instead of a board

Same compose file, same volumes, different machine. The differences that matter are not performance claims — none were measured here — but three practical ones:

If you would rather not own the machine at all, the same stack runs on a small server for a monthly fee: a small VPS. That trades the hardware cost for a recurring one, and the backup guide treats such a host as the off-site copy target either way.

Troubleshooting

Honest limits

If you would rather not run a box

Two honest alternatives: n8n Cloud — nothing to administer, priced per monthly execution, and you do not get a filesystem — or a small VPS, which is the same compose file on someone else's power supply. Everything on this site's guides works on a self-hosted instance; nothing requires Cloud.

If what you are putting on the machine is invoice automation, the pack this site sells is eleven workflows for that job, self-hosted, no AI and no API key: Invoice Ledger — USD 49, also listed on n8n.io.

Sources

  1. Container registry manifest for n8nio/n8n:2.44.5 and n8nio/runners:2.44.5, read from the Docker Hub registry API on 2026-10-22 (linux/amd64, linux/arm64). Reproduce with docker manifest inspect n8nio/n8n:2.44.5.
  2. Raspberry Pi documentation — Raspberry Pi OS (64-bit for Pi 3, 4, 5; 32-bit for older models; Lite edition for headless). Read 2026-10-22.
  3. n8n docs — Install using Docker Compose (“At least 4 GB of RAM and 2 vCPUs”; sandbox uses Docker-in-Docker; Docker Engine and Compose v2 prerequisite). Read 2026-10-22.
  4. n8n-hosting — docker-compose/withPostgres (n8n, PostgreSQL 18 with PGDATA, separate n8nio/runners service). Read 2026-10-22.
  5. n8n docs — Back up and restore (encryption key required to restore credentials). Read 2026-10-22.
  6. n8n docs — Configure webhook URLs with a reverse proxy. Read 2026-10-22.
  7. n8n docs — Executions environment variables (EXECUTIONS_DATA_MAX_AGE 336, EXECUTIONS_DATA_PRUNE_MAX_COUNT 10,000, storage modes). Read 2026-10-22.
  8. n8n docs — Install with npm (npm-based installs are deprecated from n8n 3.0; npx n8n documented for trying n8n; Node.js 20.19 to 24.x) and one-line setup (curl -fsSL https://get.n8n.io | sh). Read 2026-10-22.
  9. Docker docs — Install Docker Engine on Debian (convenience script “requires root or sudo privileges”; the script is described as suitable for testing and development). Read 2026-10-22.

Version note: n8n 2.44.5 was the published npm latest and the compose image tag used above on 2026-10-22. Replace it with the release you have read about; pinning is the point.