Installation Guide
This guide covers different installation methods for n8n, from local development to production deployments. Choose the method that best fits your infrastructure and requirements.Requirements:
- Node.js 22.16+ (for npm installation)
- Docker 20.10+ (for Docker installation)
- PostgreSQL 13+ (recommended for production)
Installation Methods
npm
Best for local development and small deployments
Docker
Recommended for production and containerized environments
Kubernetes
Best for large-scale, highly available deployments
npm Installation
Global Installation
Install n8n globally using npm:1
Install n8n
2
Start n8n
3
Configure (Optional)
Set environment variables for your setup:
Quick Start (No Installation)
For trying n8n without installation:Running Specific Commands
The n8n CLI supports multiple commands:The n8n binary is located at
/packages/cli/bin/n8n in the source code. It checks your Node.js version and loads the configuration before starting.Docker Installation
Basic Docker Setup
1
Create Data Volume
2
Run n8n Container
3
Check Status
Docker Compose Setup
For production deployments, use Docker Compose:docker-compose.yml
Docker Compose with Queue Mode
For high-volume workflows, use queue mode with separate worker instances:docker-compose-queue.yml
Queue mode requires Redis and separates the main instance (UI + triggers) from worker instances (workflow execution). This allows horizontal scaling of workers.
Configuration
Essential Environment Variables
n8n is highly configurable through environment variables:Database Configuration
Security Configuration
Webhook & URL Configuration
Execution Configuration
Logging & Monitoring
Configuration File
Alternatively, use a configuration file:config/default.json
~/.n8n/config/ directory or set NODE_CONFIG_DIR environment variable.
Production Deployment
Reverse Proxy Setup (nginx)
For production, put n8n behind a reverse proxy:Systemd Service
Create a systemd service for n8n:/etc/systemd/system/n8n.service
Building from Source
For development or custom builds:1
Clone Repository
2
Install Dependencies
3
Build All Packages
Build output is redirected to avoid overwhelming the console. Check
build.log for any errors.4
Start Development
Advanced Configuration
Multi-Main Setup (High Availability)
For enterprise deployments, enable multi-main mode:Multi-main setup requires:
- Queue mode (Redis)
- Enterprise license
- PostgreSQL database
- Multiple n8n main instances
External Secrets
Load sensitive values from external sources:Custom Node Loading
Load custom nodes from a directory:Upgrading n8n
npm Upgrade
Docker Upgrade
Backup & Recovery
Backup Database
Backup n8n Data Directory
Monitoring & Health Checks
Health Check Endpoint
n8n exposes a health check endpoint:Metrics (Prometheus)
Enable Prometheus metrics:Troubleshooting
Database Connection Issues
1
Check Database
2
Verify Configuration
Check environment variables are set correctly:
3
Check Logs
Performance Issues
- Use PostgreSQL instead of SQLite
- Enable queue mode for high-volume workflows
- Increase worker instances
- Configure execution timeouts appropriately
- Enable database connection pooling
Permission Errors
Getting Help
Community Forum
Get installation support from the community
Documentation
Detailed configuration documentation
GitHub Issues
Report installation bugs
Enterprise Support
Contact for enterprise installation support