This guide uses Docker Compose to run a self-hosted n8n instance.
For Docker installation, see Docker.
mkdir n8n-compose
cd n8n-compose
mkdir local-files
cat <<'YAML' > compose.yaml
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
ports:
- "5678:5678"
environment:
- N8N_HOST=localhost
- N8N_PROTOCOL=http
- N8N_PORT=5678
- N8N_ENCRYPTION_KEY=your-secure-encryption-key-change-this
- TZ=UTC
- GENERIC_TIMEZONE=UTC
volumes:
- n8n_data:/home/node/.n8n
- ./local-files:/files
volumes:
n8n_data:
YAML
docker compose up -d
Open http://YOUR-SERVER:5678 and complete the setup wizard.
The first user you create becomes the administrator.
For production deployments:
N8N_ENCRYPTION_KEYN8N_PROTOCOL=https and configure a reverse proxyn8n_data volume and encryption keyN8N_SECURE_COOKIE=true when using HTTPSSee n8n Configuration for detailed configuration options.
💼 Professional Services: Need expert help with your N8N Docker deployment? We offer consulting, training, and support. Contact our team →