Table of Contents
Installing n8n on a DigitalOcean Droplet takes 2–3 hours and costs $6–$12/month just for the server — before accounting for your time managing Docker, SSL certificates, and n8n version updates. This guide covers every step of the installation: creating the Droplet, setting up Docker and Caddy, configuring your domain, securing HTTPS, and keeping n8n updated. There's also a section on a managed n8n hosting option at $2.99/month if you'd rather skip the DevOps entirely — used by 1,000+ teams who want n8n without touching a server.
What is n8n on DigitalOcean?
n8n is an open-source workflow automation platform that lets you connect apps, automate tasks, and build complex multi-step workflows using a visual drag-and-drop editor. Unlike SaaS automation tools like Zapier, n8n is open-source and designed to be self-hosted — meaning you run it on your own infrastructure with unlimited executions and no per-task pricing.
DigitalOcean is a cloud infrastructure provider known for simple, predictable pricing on virtual private servers (VPS) called "Droplets." Running n8n on a DigitalOcean Droplet gives you full control over your automation environment: your data stays on your server, you choose your region, and you're not bound by any platform's execution limits.
There are two ways to run n8n on DigitalOcean:
- DigitalOcean Marketplace (1-click): Install the pre-configured n8n Droplet image from the DigitalOcean App Marketplace in minutes.
- Manual Docker + Caddy setup: Create a fresh Droplet, install Docker, and deploy n8n using the official
n8n-docker-caddyconfiguration for full control.
Both methods are covered in this guide. The end result is the same: a production-ready n8n instance accessible at your custom domain over HTTPS.
DigitalOcean n8n Pricing: Droplet Costs in 2026
DigitalOcean charges by the hour for Droplets (billed monthly). Here are the relevant Droplet sizes for running n8n in 2026:
| Droplet Plan | RAM | CPU | Storage | Monthly Cost | n8n Suitability |
|---|---|---|---|---|---|
| Basic (1 GB) | 1 GB | 1 vCPU | 25 GB SSD | $6 | Dev / low traffic |
| Basic (2 GB) | 2 GB | 1 vCPU | 50 GB SSD | $12 | Recommended minimum |
| Basic (4 GB) | 4 GB | 2 vCPU | 80 GB SSD | $24 | Heavy workflows |
| Basic (8 GB) | 8 GB | 4 vCPU | 160 GB SSD | $48 | Enterprise scale |
DigitalOcean blocks outbound SMTP ports 25, 465, and 587 on all new accounts to prevent spam. This means n8n's email features (user invitations, workflow alerts) will silently fail until you open a support ticket requesting SMTP access. This is one of the most common undocumented gotchas for n8n self-hosters on DigitalOcean.
In addition to the Droplet cost, budget for a domain name ($10–15/year) if you don't already own one. DigitalOcean's automated backups add 20% to the Droplet cost but are worth enabling for production instances.
Prerequisites: What You Need Before Installing n8n
Before creating your n8n instance on DigitalOcean, you'll need:
- A DigitalOcean account — sign up at digitalocean.com. New accounts get a $200 credit valid for 60 days.
- A registered domain name — you'll need a domain (e.g.,
n8n.yourdomain.com) to access n8n over HTTPS. Any registrar works (Namecheap, GoDaddy, Cloudflare, etc.). - Basic Linux/SSH knowledge — you'll need to run commands via SSH. No advanced sysadmin experience required, but familiarity with a terminal helps.
- SSH client — macOS/Linux have one built in. Windows users can use PowerShell, PuTTY, or the DigitalOcean browser console.
Method 1: Install n8n via DigitalOcean Marketplace (1-Click)
The DigitalOcean Marketplace provides a pre-built n8n Droplet image that combines n8n, Docker, and Caddy in a single click. This is the fastest way to get n8n running on DigitalOcean.
Steps for Marketplace Installation
- Go to marketplace.digitalocean.com/apps/n8n and click Create n8n Droplet.
- Choose your Droplet plan (2 GB RAM / $12/mo recommended).
- Select your datacenter region (choose one close to your users).
- Add an SSH key or choose password authentication.
- Click Create Droplet. Your Droplet will be ready in ~60 seconds.
- Once the Droplet is provisioned, note its public IP address.
- SSH into the server:
ssh root@YOUR_DROPLET_IP - Run the setup script that the Marketplace image includes to configure your domain and SSL.
The DigitalOcean Marketplace n8n image is based on the official n8n-docker-caddy repository. It configures n8n with Caddy as the reverse proxy, which handles SSL automatically. After the Droplet is created, you'll still need to configure your domain's DNS A record and edit the .env and Caddyfile to point to your domain.
The Marketplace method is quick but gives you less control over the configuration than a manual Docker Compose setup. For most users running n8n for personal or small-team automation, it's perfectly sufficient.
Method 2: Install n8n on DigitalOcean with Docker + Caddy
This method gives you full control by setting up n8n from scratch using Docker and Caddy on a fresh Ubuntu Droplet. This is what the DigitalOcean community tutorials recommend and what most production deployments use.
Step 1: Create a DigitalOcean Droplet
- Log in to your DigitalOcean account and click Create > Droplets.
- Choose Ubuntu 22.04 (LTS) x64 as your image.
- Select the Basic plan, 2 GB RAM / 1 vCPU / 50 GB SSD ($12/mo).
- Pick a datacenter region near your users.
- Under Authentication, add your SSH public key (recommended) or set a root password.
- In the Hostname field, name it something like
n8n-server. - Click Create Droplet and note the public IP address.
Step 2: Connect via SSH and Update the System
Open your terminal and connect to the new Droplet:
ssh root@YOUR_DROPLET_IP
Update all system packages first:
apt update && apt upgrade -y
Step 3: Install Docker
apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker && systemctl start docker
Verify Docker is running:
docker --version
docker compose version
Step 4: Clone the n8n Docker Caddy Repository
The official n8n-docker-caddy repo provides the recommended production Docker Compose configuration with Caddy for automatic SSL:
cd /home
git clone https://github.com/n8n-io/n8n-docker-caddy.git
cd n8n-docker-caddy
Step 5: Create Docker Volumes
docker volume create caddy_data
docker volume create n8n_data
Step 6: Configure Environment Variables
Edit the .env file to set your domain and timezone:
nano .env
Update these values (replace with your actual domain):
DATA_FOLDER=/home/n8n-docker-caddy
SUBDOMAIN=n8n
DOMAIN_NAME=yourdomain.com
GENERIC_TIMEZONE=America/New_York
Save with Ctrl+O, Enter, Ctrl+X.
Step 7: Update the Caddyfile
nano caddy_config/Caddyfile
Replace the placeholder domain with your full subdomain:
n8n.yourdomain.com {
reverse_proxy n8n:5678 {
flush_interval -1
}
}
Step 8: Open Firewall Ports and Start n8n
ufw allow 80
ufw allow 443
docker compose up -d
Wait 1–2 minutes for Caddy to obtain the SSL certificate and for n8n to start. Then open https://n8n.yourdomain.com in your browser — you should see the n8n setup screen.
On first visit, n8n will prompt you to create an owner account (email + password). After that, you can optionally register your community instance with your email to unlock free premium features including execution history and advanced debugging.
Setting a Custom Domain for n8n on DigitalOcean
You need to point your domain to your Droplet before Caddy can issue an SSL certificate. Add an A record in your domain registrar's DNS management panel:
| Type | Name/Host | Value/Points To | TTL |
|---|---|---|---|
A | n8n | YOUR_DROPLET_IP | 600s |
DNS propagation typically takes 10–30 minutes but can take up to 48 hours in rare cases. You can verify with:
dig n8n.yourdomain.com +short
This should return your Droplet's IP address. Once the DNS resolves, Caddy will automatically obtain and configure your SSL certificate.
Securing n8n with HTTPS on DigitalOcean
If you used the Caddy method above, HTTPS is already configured automatically — Caddy handles Let's Encrypt certificate issuance and renewal without any manual intervention. This is one of Caddy's key advantages over Nginx for self-hosted deployments.
If You Prefer Nginx + Certbot Instead
Some users prefer Nginx as the reverse proxy. Install it alongside Certbot:
apt install -y nginx certbot python3-certbot-nginx
Create an Nginx config at /etc/nginx/sites-available/n8n:
server {
listen 80;
server_name n8n.yourdomain.com;
location / {
proxy_pass http://localhost:5678;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Enable the config and get the SSL certificate:
ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d n8n.yourdomain.com
Certbot will automatically update your Nginx config to redirect HTTP to HTTPS and add the SSL certificate paths.
OpenHosst handles Docker, SSL, domain config, and updates for you. Run managed n8n from $2.99/month with a 7-day free trial.
Start Free TrialHow to Update n8n on DigitalOcean
Keeping n8n updated is important for security patches, bug fixes, and access to new nodes. With Docker Compose, updates are a three-command process.
Step 1: Back Up Your Data First
tar -czf n8n-backup-$(date +%F).tar.gz /home/n8n-docker-caddy
Store this backup off-server (DigitalOcean Spaces, S3, or your local machine) before proceeding.
Step 2: Pull the Latest n8n Image
cd /home/n8n-docker-caddy
docker compose pull
This downloads the latest n8nio/n8n:latest image from Docker Hub.
Step 3: Restart with the New Image
docker compose up -d
Docker Compose will recreate the n8n container using the new image while preserving your data volumes. Verify the new version in n8n under Settings > About.
n8n releases updates frequently (sometimes weekly). Before a major version update, check the n8n GitHub releases page for breaking changes that could affect existing workflows. Test critical workflows after every update.
Troubleshooting n8n on DigitalOcean: Common Issues
| Problem | Cause | Fix |
|---|---|---|
| n8n won't load at the domain | DNS not propagated yet | Wait 10–30 min; verify with dig n8n.yourdomain.com |
| SSL certificate error | Port 80/443 blocked or DNS wrong | Run ufw allow 80 && ufw allow 443; check DNS A record |
| Webhooks not receiving data | WEBHOOK_URL env var not set |
Add WEBHOOK_URL=https://n8n.yourdomain.com/ to .env |
| Emails not sending | DigitalOcean blocks SMTP ports | Open a DO support ticket to unblock ports 465/587 |
| n8n crashes under load | Insufficient RAM (1 GB Droplet) | Upgrade to 2 GB Droplet; enable queue mode with Redis |
| JavaScript heap out of memory | Node.js memory limit | Add NODE_OPTIONS=--max-old-space-size=2048 to environment |
| Permission denied on volumes | File ownership mismatch | Run chown -R 1000:1000 ./n8n_data |
| Container keeps restarting | Config error or DB connection fail | Check logs: docker compose logs -f n8n |
DigitalOcean vs Managed n8n Hosting: True Cost Comparison
The monthly Droplet fee is only part of the real cost of running n8n on DigitalOcean. When you account for setup time and ongoing maintenance, the true cost is significantly higher.
| Cost Factor | DIY DigitalOcean | OpenHosst Managed |
|---|---|---|
| Monthly server cost | $12/mo (2 GB Droplet) | $2.99/mo |
| Initial setup time | 2–3 hours | ~5 minutes |
| SSL certificate | Manual (Caddy/Certbot) | Automatic |
| Custom domain setup | Manual DNS + Caddy config | One-click |
| n8n updates | Manual (your responsibility) | Automatic |
| SMTP setup | Support ticket + config | Pre-configured |
| Backups | Manual or +$2.40/mo | Automatic |
| Support | Community forums | 24/7 human support |
| Monthly maintenance time | ~30 min/month | 0 min |
| First Year Total (server only) | $144+ | $35.88 |
DigitalOcean makes sense when you need total control over your infrastructure, want to co-locate n8n with other services on the same Droplet, or have a DevOps background and enjoy managing servers. For everyone else, the economics strongly favor managed hosting.
Skip the Setup: Managed n8n at $2.99/Month
If the installation guide above looks like more work than you want, OpenHosst managed n8n hosting gives you everything you'd build on DigitalOcean — but without any of the server work.
Here's what you get compared to the DIY DigitalOcean approach:
- Unlimited executions — no task caps, no per-execution pricing
- Your own n8n instance — not shared, full access including community nodes
- Custom domain — point your subdomain with one click
- Automatic SSL — HTTPS configured automatically
- Automatic n8n updates — always on the latest stable release
- 24/7 support — real humans via Discord, email, WhatsApp, and Telegram
- 7-day free trial — no payment required to start
OpenHosst has hosted 1,000+ n8n instances with a 4.6/5 Trustpilot rating. Teams that migrated from DigitalOcean typically report saving 2–4 hours/month in maintenance time.
Already running n8n on DigitalOcean? Migration is easy: export your workflows from n8n (Settings > n8n API) and import them into your OpenHosst instance. The process takes 15–30 minutes. Credentials must be re-entered manually as they are encrypted client-side and cannot be exported — a security feature of n8n's design.
Frequently Asked Questions About n8n on DigitalOcean
How much does it cost to run n8n on DigitalOcean?
Running n8n on DigitalOcean requires a Droplet starting at $6/month (1 GB RAM) or $12/month (2 GB RAM, recommended). Add a domain ($10–15/year) and optional automated backups (+20% of Droplet cost). Total annual cost is typically $82–$159 for the server alone, compared to $35.88/year for managed n8n hosting at $2.99/month.
What is the minimum Droplet size for n8n?
The minimum viable Droplet is 1 GB RAM / 1 vCPU at $6/month, suitable for development and low-traffic use. For production, n8n recommends at least 2 GB RAM ($12/month). Heavy workflows with many simultaneous executions may require 4 GB RAM ($24/month). Running n8n with the 1 GB Droplet in production often results in crashes under load — start with 2 GB.
How do I update n8n on DigitalOcean?
SSH into your Droplet, navigate to your n8n installation directory (cd /home/n8n-docker-caddy), back up your data (tar -czf backup-$(date +%F).tar.gz .), then run docker compose pull followed by docker compose up -d. The update takes 1–2 minutes and your workflows are preserved. Always review the n8n release notes before major version updates.
Does DigitalOcean block SMTP ports for n8n email?
Yes. DigitalOcean blocks outbound SMTP ports 25, 465, and 587 by default on all new accounts. This silently breaks n8n's email features (user invitations, workflow email alerts). To fix it, open a support ticket at cloud.digitalocean.com/support requesting that SMTP ports be unblocked for your account. This typically takes 1–2 business days to process. This is the most common undocumented issue for n8n on DigitalOcean.
Should I use the DigitalOcean Marketplace or install manually?
The DigitalOcean Marketplace 1-click n8n install is faster to set up and uses the official n8n-docker-caddy configuration. Manual installation gives you more control over PostgreSQL vs SQLite, custom environment variables, and the update process. For most users, the Marketplace is fine. For production deployments requiring high availability or specific configurations, manual Docker Compose installation with PostgreSQL is better.
How do I secure n8n on DigitalOcean with HTTPS?
With the Caddy method (n8n-docker-caddy), HTTPS is automatic — Caddy obtains and renews Let's Encrypt certificates without any configuration. With Nginx, install Certbot (apt install certbot python3-certbot-nginx) and run certbot --nginx -d n8n.yourdomain.com. Ensure ports 80 and 443 are open in your UFW firewall: ufw allow 80 && ufw allow 443.
How long does it take to install n8n on DigitalOcean?
A complete n8n installation on DigitalOcean — Droplet creation, Docker setup, domain DNS, SSL, and initial configuration — takes 2–3 hours for someone with basic Linux experience. Add 30–60 minutes for first-timers or if you encounter troubleshooting. By contrast, managed n8n on OpenHosst takes under 5 minutes to deploy with no technical knowledge required.
What database should I use for n8n on DigitalOcean?
SQLite (n8n's default) works for development and low-volume use. For production, use PostgreSQL — it provides better performance, supports n8n's queue mode for scaling concurrent executions, and is safer for data integrity. Run PostgreSQL as a separate Docker Compose service alongside n8n. The DigitalOcean community tutorial covers this PostgreSQL + n8n Docker Compose setup in detail.
How do I back up n8n on DigitalOcean?
Back up your Docker volume data with: tar -czf n8n-backup-$(date +%F).tar.gz /home/n8n-docker-caddy. For PostgreSQL, also dump the database: docker exec n8n-db pg_dump -U n8n n8n > n8n-db-$(date +%F).sql. Store backups off-server in DigitalOcean Spaces or another cloud storage. Enable DigitalOcean's automated Droplet backups (+20% of Droplet cost) as an additional safety net.
Can I migrate n8n workflows from DigitalOcean to managed hosting?
Yes. Export workflows from your n8n instance (individually as JSON, or via the n8n API), then import them into your new managed n8n instance. Credentials cannot be exported (they're encrypted) and must be re-entered manually. A full migration of 10–20 workflows typically takes 15–30 minutes. OpenHosst can assist with migration as part of the onboarding process.
What is the difference between n8n on DigitalOcean and n8n Cloud?
n8n on DigitalOcean is self-hosted: you manage the server, updates, SSL, and scaling, starting at $12/month for the Droplet. n8n Cloud is n8n's official SaaS product starting at $20/month, where n8n manages everything but limits executions. OpenHosst managed n8n ($2.99/month) is a third path: you get the self-hosted experience (unlimited executions, your own instance) with all infrastructure managed for you — like n8n Cloud but cheaper and with more control.
Is n8n on DigitalOcean reliable for production?
Yes, with proper configuration: use 2 GB+ RAM, configure PostgreSQL instead of SQLite, enable HTTPS, set up automated backups, and configure n8n queue mode with Redis for high-concurrency workloads. The main risk is that you are fully responsible for uptime, security patches, and version updates. If a container crashes or the server needs a restart, your workflows pause until you intervene. For teams without DevOps resources, managed hosting provides better reliability guarantees.
OpenHosst managed n8n — unlimited executions, automatic updates, custom domain, 24/7 support. Starting at $2.99/month.
7-day free trial · Money-back guarantee · Cancel anytime