- Prepare Windows for n8n with Docker and WSL.
- Diagnose errors before blaming the workflow.
- Start a minimal stack that you can later connect to Ollama.
Pre-installation checklist
- Windows up to date.
- Virtualization enabled in BIOS/UEFI.
- WSL 2 installed with a working Linux distro.
- Docker Desktop using the WSL 2 backend.
- Full restart after enabling Windows features.
# En PowerShell wsl --status wsl --list --verbose docker version docker compose version # Si Docker no responde, abre Docker Desktop y espera a que indique "Engine running". # Después prueba: docker run --rm hello-world
Minimal stack with persistent volume
For local testing you can start with SQLite. In production, Postgres and a public URL with HTTPS are better—but first we need an instance that starts the same way every time.
# docker-compose.yml
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=localhost
- N8N_PORT=5678
- N8N_PROTOCOL=http
- N8N_SECURE_COOKIE=false
- TZ=Europe/Madrid
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:docker compose up -d docker compose logs -f n8n # Abre: # http://localhost:5678
Common errors and quick troubleshooting
- Port in use: change `5678:5678` to `5680:5678`.
- Docker won't start: check WSL, virtualization, and restart.
- Data disappears: you didn't mount a persistent volume.
- Ollama won't connect: from Docker, `localhost` points to the container, not Windows.
- Execute Command can't see your programs: run inside the container, not on the host.
Official sources
- n8n: Install with Docker
- n8n: Execute Command node