Can you run n8n on Docker?
Quick Answer: Yes. n8n provides an official Docker image (n8nio/n8n) that can be run with a single command, supports persistent volumes for workflow data, and works with Docker Compose for production setups including PostgreSQL. Self-hosted n8n on Docker is free under the Sustainable Use License and is the recommended deployment path.
Running n8n on Docker
Docker is the recommended deployment method for self-hosted n8n. The official image is maintained by the n8n team and updated with each release.
Quick Start — Single Container
Run n8n with one command, storing data in a named volume:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
n8nio/n8n
Access the editor at http://localhost:5678.
Production Setup — Docker Compose
For production, use Docker Compose with PostgreSQL for data storage:
services:
postgres:
image: postgres:15
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: n8n
volumes:
- postgres_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
Recommended Environment Variables
N8N_ENCRYPTION_KEY: Encrypts credentials at restN8N_HOST: External hostname (for webhooks)WEBHOOK_URL: Full URL for webhooks (important behind reverse proxy)N8N_BASIC_AUTH_ACTIVE: Enables basic auth for the editor
Reverse Proxy
For public deployments, place n8n behind Caddy, Nginx, or Traefik for TLS termination. This is required for webhooks from external services.
Backup
- Back up the PostgreSQL database nightly
- Export workflows with the n8n CLI:
n8n export:workflow --all --output=/backups - Store encryption key securely (loss = inability to decrypt credentials)
Scaling Considerations
- Default single-instance runs webhook and worker processes together
- For high throughput, enable "queue mode" with Redis and separate worker containers
- Worker containers use the same image with
--workerflag
Resource Requirements
- Minimum: 1 vCPU, 1 GB RAM
- Recommended for production: 2 vCPU, 4 GB RAM
- Disk: 10 GB for database and logs
Related Questions
- What are the best workflow automation tools for technical writers in 2026?
- What are the best AI-native automation tools in 2026?
- What are the best automation tools for finance and AP teams in 2026?
- What are the best automation tools for solo founders in 2026?
- What are the best automation tools for nonprofits in 2026?
Related Tools
Activepieces
No-code workflow automation with self-hosting and AI-powered features
Workflow AutomationAutomatisch
Open-source Zapier alternative
Workflow AutomationBardeen
AI-powered browser automation via Chrome extension
Workflow AutomationCalendly
Scheduling automation platform for booking meetings without email back-and-forth, with CRM integrations and routing forms for lead qualification.
Workflow AutomationRelated Rankings
Best Durable Workflow Engines for Production in 2026
A ranked list of the best durable workflow engines for production deployments in 2026. Durable workflow engines persist execution state to a database so that long-running workflows survive process restarts, deployments, and infrastructure failures. The ranking covers Temporal, Prefect, Apache Airflow, Camunda, Windmill, and n8n. Tools were evaluated on production reliability, developer experience, scalability, open-source health, and documentation quality. The shortlist intentionally mixes code-first engines (Temporal, Prefect, Airflow) with hybrid visual platforms (Camunda, Windmill, n8n) to reflect how production teams actually choose workflow engines in 2026.
Best No-Code Automation Platforms in 2026
A ranked list of no-code automation platforms in 2026. The ranking covers visual workflow builders that allow non-engineering teams to connect SaaS apps, route data, and add conditional logic without writing code. Entries cover proprietary cloud platforms (Zapier, Make, Pipedream, IFTTT) and open-source visual builders (n8n, Activepieces). Scoring reflects integration breadth, pricing accessibility, visual editor ease, reliability and error handling, and self-hosting availability.
Dive Deeper
Migrating 23 Make Scenarios to Self-Hosted n8n: a 3-Week Breakdown
Anonymized retrospective of a DTC ecommerce brand migrating 23 Make scenarios to a self-hosted n8n instance over three weeks. Tooling cost dropped from $348/month on Make Teams to roughly $12/month on a Hetzner VPS, but credential and webhook recreation consumed about 40% of total project time.
Trigger.dev vs Inngest 2026: OSS Durable Runners Compared
Trigger.dev (2022, London) is a fully Apache 2.0 durable runner with task-based authoring, machine-size selection, and first-class self-host. Inngest (2021, San Francisco) is a developer-first event-driven step platform with an open-source dev server and a managed cloud (50K step runs/month free, $20/month Hobby). This 2026 comparison covers license, programming model, pricing, observability, and self-host options.
Inngest vs Temporal 2026: Durable Functions vs Durable Workflows
Inngest (2021, San Francisco) is a developer-first durable functions platform with TypeScript and Python SDKs, 50,000 step runs/month free, and Hobby pricing from $20/month. Temporal (2019) is the heavyweight durable workflow engine with seven-language SDK coverage, Cassandra-backed scale, and Cloud pricing from roughly $200/month at low volume or $2.5-4.5K/month self-host. This 2026 comparison covers programming model, pricing, scale ceiling, and operational footprint.