Self-hosting n8n gives you unlimited workflows, full control over your data, and room to scale without platform limits. This guide covers three deployment paths, Docker, a DigitalOcean droplet, and AWS EC2, plus the configuration, monitoring, security, and cost details that make a deployment production-ready.

Why self-host?

Self-hosting removes the workflow caps of the cloud tier, keeps your data fully private and under your control, lets you add custom integrations and plugins, becomes cost efficient at scale, and allows complete customization of the environment.

Option 1: Docker (easiest)

Docker makes deployment consistent across any platform:

docker run -it --rm \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

The volume mount at ~/.n8n keeps your workflows and credentials between restarts.

Option 2: DigitalOcean droplet

For an always-on instance, spin up a droplet: create an Ubuntu droplet ($5 to $20 per month), SSH into it, install Docker, run the n8n container with persistent storage, set up an Nginx reverse proxy with SSL, and configure firewall rules to limit exposure.

Option 3: AWS EC2

On AWS, launch a t3.micro instance (free-tier eligible), configure security groups for ports 22, 80, and 443, install Docker and n8n, use RDS for a managed PostgreSQL database, set up Route 53 for DNS, and optionally add a CloudFront CDN.

Configuration management

A handful of environment variables drive a real deployment:

N8N_HOST=your-domain.com
N8N_PORT=5678
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=your-db-host
DB_POSTGRESDB_DATABASE=n8n
WEBHOOK_TUNNEL_URL=https://your-domain.com/

Pointing n8n at PostgreSQL rather than the default file store is the key change for reliability at scale.

Monitoring and updates

Monitor CPU, memory, and disk usage, aggregate logs with a stack like ELK or CloudWatch, automate backups to S3, plan for minor version upgrades, and keep your Docker images updated.

Security best practices

Always serve over HTTPS with a valid certificate, enable n8n authentication with strong passwords, restrict access with a VPN or IP whitelisting, keep database credentials in a secrets manager, back up the database and workflows regularly, and monitor security logs for failed access attempts.

Estimated costs

Expect roughly $5 to $20 per month for DigitalOcean compute, $0 to $50 on AWS depending on free-tier usage, $15 to $50 for managed PostgreSQL, and about $12 per year for a domain and SSL.

Next steps

A well-run self-hosted instance is the foundation for serious automation. If you want help provisioning, securing, or migrating an n8n deployment, get in touch.