Self-Host n8n on DigitalOcean in 2026 | Full Guide, Costs, Downloads, and Best Practices

Learn how to install and run n8n on DigitalOcean in 2026. This full self-host guide includes step-by-step instructions, cost data, downloadable configs, security tips, best practices, and performance expectations.

RO@robertg

Introduction

Running n8n on DigitalOcean gives you full ownership of your automation stack. You control data, execution limits, credentials, and infrastructure. This guide explains how to self-host n8n on DigitalOcean using a production-ready setup. You get cost data, performance benchmarks, security steps, and downloadable configuration files.

This article expands on an existing walkthrough published on NXGN Tools and adds updated pricing, scaling guidance, and long-term maintenance tips.


Why Self-Host n8n on DigitalOcean

  • You keep all workflow data on your own server
  • No execution limits or pay-per-run pricing
  • Lower monthly cost once workflows scale
  • Full control over updates and versions
  • Support for custom nodes and internal APIs

According to n8n usage data shared by the community, self-hosted instances often replace paid automation plans once workflows exceed 5,000 executions per month.


What You Need Before Starting

  • DigitalOcean account
  • Ubuntu 22.04 droplet
  • Domain name with DNS access
  • Basic SSH and Linux knowledge
  • Docker and Docker Compose


DigitalOcean Cost Breakdown for n8n

Resource

Monthly Cost

2 GB RAM Droplet

$12 USD

4 GB RAM Droplet

$24 USD

Managed PostgreSQL (optional)

$15 USD

Domain Name

$1 to $15 per year

SSL via Let’s Encrypt

$0

Pricing reflects DigitalOcean rates as of January 2026.


Deployment Options


Option 1: DigitalOcean Marketplace n8n App

The Marketplace app deploys n8n with PostgreSQL, HTTPS, and health checks. This option fits teams who want fast setup and fewer infrastructure decisions.


Option 2: Docker Compose on a Droplet

This option gives full control over networking, backups, and scaling. It suits production workloads and internal automation platforms.


Step-by-Step: Self-Host n8n on DigitalOcean Using Docker


1. Create a Droplet

Create an Ubuntu 22.04 droplet with at least 2 GB RAM. Select a region close to your users.


2. Install Docker

sudo apt update
sudo apt install docker.io docker-compose-plugin


3. Create Project Directory

mkdir ~/n8n
cd ~/n8n


4. Docker Compose File

Download and save the following as docker-compose.yml.

version: "3.7"

services:
postgres:
image: postgres:14
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: strongpassword
POSTGRES_DB: n8n
volumes:
- postgres_data:/var/lib/postgresql/data

n8n:
image: n8nio/n8n
ports:
- "5678:5678"
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: strongpassword
N8N_HOST: n8n.yourdomain.com
WEBHOOK_URL: https://n8n.yourdomain.com
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: admin
N8N_BASIC_AUTH_PASSWORD: strongpassword
depends_on:
- postgres
volumes:
- n8n_data:/home/node/.n8n

volumes:
postgres_data:
n8n_data:


5. Start n8n

docker compose up -d


6. Configure DNS

Create an A record pointing your domain to the droplet IP.


Enable HTTPS with Nginx and Let’s Encrypt

sudo apt install nginx certbot python3-certbot-nginx
sudo certbot --nginx -d n8n.yourdomain.com

This secures webhooks and credentials in transit.


Performance Expectations

  • 2 GB RAM handles 5 to 10 active workflows
  • 4 GB RAM supports 15 to 30 workflows
  • 10,000 daily executions reported on small droplets

Workflow complexity and trigger frequency affect memory usage more than execution count.


Backup Strategy

  • Schedule PostgreSQL dumps
  • Back up n8n_data volume
  • Export workflows as JSON weekly

DigitalOcean snapshots add another recovery layer.


Updating n8n

docker compose pull
docker compose down
docker compose up -d

Review release notes before updating production systems.


Downloadable Resources

  • Docker Compose template
  • Nginx SSL configuration example
  • Backup shell script template


References

  • n8n official self-hosting documentation
  • DigitalOcean Marketplace n8n listing
  • DigitalOcean community tutorials


Final Notes

Self-hosting n8n on DigitalOcean gives predictable costs, strong performance, and full ownership. This setup fits SaaS founders, internal tools teams, and automation consultants who want stable infrastructure without vendor limits.