Self-Host n8n with Docker Compose
n8n is an extendable workflow automation tool. With a fair-code distribution model, n8n will always have visible source code, be available to self-host, and allow you to add your own custom functions, logic, and apps. Its node-based approach makes it easy to connect anything to everything.
Minimum Hardware Requirements
version: '3.8'
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- NODE_ENV=production
- TZ=UTC
volumes:
- n8n_data:/data
volumes:
n8n_data:
driver: local
docker-compose.yml and run:
docker compose up -d
Key Environment Variables
Recommended baseline environment configuration for this container
| Variable Name | Default / Recommended Value |
|---|---|
| N8N_BASIC_AUTH_ACTIVE | true |
| N8N_BASIC_AUTH_USER | admin |
| N8N_BASIC_AUTH_PASSWORD | supersecretpass |
| N8N_HOST | n8n.example.com |
| N8N_PORT | 5678 |
| N8N_PROTOCOL | https |
| WEBHOOK_URL | https://n8n.example.com/ |
| GENERIC_TIMEZONE | UTC |
VPS RAM & Server Sizing Calculator
Planning to run n8n alone or alongside other self-hosted containers on one VPS? Toggle apps to calculate your exact RAM needs with a 25% safety buffer.
Matched Cloud VPS Tiers for Selected Workload:
Replaces Zapier
Commercial cloud automation platform charging steep fees per task and restricting multi-step workflows on basic plans.
More Automation Apps View All →
Compare n8n
Benchmark specs head-to-head with other open-source alternatives
Compare n8n Side-by-Side
Select any open-source tool from the dropdown to run a hardware, memory, and popularity benchmark against n8n.