Run n8n locally on Windows with Docker (free) — step-by-step + the errors you'll hit

My n8n Cloud trial was running out, so I set up n8n on my Windows PC with Docker Desktop instead. Here’s the full setup, plus every error and pop-up I ran into, so you don’t get stuck.

What you need

  • Docker Desktop (free for personal use) — Windows, AMD64 for most laptops
  • Optional: Claude Code (paid Claude plan) to write the file for you — or just copy the file below

1. Install Docker Desktop
Keep “Use WSL 2” ticked. If the installer says “Installation failed. One prerequisite is not fulfilled: Virtual Machine Platform” → right-click the installer → Run as administrator → choose All-users installation → restart.
After the restart, open Docker Desktop and wait for Engine running (bottom-left). If it says Resource Saver mode, click Resume.

2. Make a folder and add this docker-compose.yml

mkdir c:/n8n-local
cd c:/n8n-local
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - GENERIC_TIMEZONE=UTC
      - TZ=UTC
      - N8N_HOST=localhost
      - WEBHOOK_URL=http://localhost:5678/
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

The volumes part is the important bit — without it your workflows are wiped when the container is rebuilt (update / docker compose down).

3. Start it

docker compose up -d

Open http://localhost:5678 and create the owner account (local only — not your n8n Cloud login).

Errors / pop-ups you may see

  • failed to connect to the docker API → Docker Desktop isn’t open
  • Windows Firewall asks about Docker → Cancel is fine for localhost (Allow exposes it to your Wi-Fi)
  • port is already allocated → change ports to "5679:5678" and open localhost:5679
  • “This site can’t be reached” → n8n is still starting, wait 20 s and refresh
  • Never run docker compose down -v — the -v deletes the volume and your workflows

Limit: when your PC sleeps, n8n sleeps, and outside services can’t reach webhooks on localhost. For 24/7 you need a server (I’m doing that next).

I made a 10-minute walkthrough of all of this (including letting Claude Code write the compose file and explaining each command for beginners):

Happy to help if you hit a different error — post it below.

Useful walkthrough, and the volume warning is the most important point. Two additions for when this moves beyond a local test: set N8N_ENCRYPTION_KEY explicitly and back it up together with the volume, because stored credentials are encrypted with it and cannot be recovered if the key is lost. Also, since webhooks need a public address, setting WEBHOOK_URL to the real public URL once you move to a server avoids broken trigger URLs, and putting n8n behind a reverse proxy with HTTPS is the usual next step for the 24/7 setup you mention.