← All Guides

n8n Self-Hosted: Complete Setup Tutorial for Solopreneurs

Deploy unlimited automations on your own server—save thousands yearly while maintaining full control

TL;DR

Self-host n8n using Docker on a $6/month VPS to get unlimited executions (vs. cloud limits), full data ownership, and save $500+ yearly. This guide covers deployment on DigitalOcean, SSL setup, security hardening, and automated backups—deployable in under 2 hours.

Why Self-Host n8n as a Solopreneur?

n8n has become the go-to automation platform for solopreneurs who want Zapier-level power with developer-level flexibility. But once your automations scale beyond hobby projects, the cloud pricing becomes a real cost center. Self-hosting eliminates those limits while giving you complete control over your data and infrastructure.

40,000+
GitHub stars for n8n's open-source repository
Source: GitHub, 2025

The comparison between n8n, Zapier, and Make shows why technical solopreneurs increasingly choose n8n—it's the only major platform offering a truly unlimited self-hosted option.

Self-Hosted vs Cloud: Cost Comparison

Factor n8n Cloud Self-Hosted
Monthly Cost $20-50+ $5-15
Executions 2,500-10,000/mo Unlimited
Data Location n8n servers Your server
Setup Time 5 minutes 1-2 hours
Maintenance Zero ~30 min/month
Custom Nodes Limited Full access
$500+
Average yearly savings with self-hosted n8n
Source: Community surveys, 2025

Self-Hosted Benefits

  • Unlimited workflow executions
  • Full data ownership
  • Install any community node
  • No vendor lock-in
  • Custom integrations possible

Self-Hosted Trade-offs

  • Initial setup required
  • Monthly maintenance time
  • You handle security
  • Need basic server knowledge
  • No official support

Prerequisites: What You'll Need

Before starting, ensure you have:

No Docker experience required—this guide provides copy-paste configurations. If you're completely new to automation, consider starting with our first AI automation tutorial before deploying infrastructure.

Step-by-Step: Deploy n8n on DigitalOcean

We'll use DigitalOcean for this guide because it offers the best balance of simplicity, cost, and reliability for solopreneurs. The same approach works on Hetzner (cheaper), Linode, or Vultr.

1 Create a Droplet (VPS)

Sign up at DigitalOcean (use referral link for $200 free credits). Create a new Droplet with:

  • Image: Ubuntu 22.04 LTS
  • Plan: Basic $6/mo (1GB RAM, 1 vCPU)
  • Region: Closest to your users
  • Authentication: SSH key (recommended) or password
2 Connect and Install Docker

SSH into your server and run these commands:

# Connect to your server
ssh root@your-server-ip

# Update system packages
apt update && apt upgrade -y

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

# Install Docker Compose
apt install docker-compose -y

# Verify installation
docker --version
docker-compose --version
5 min
Average time to complete Docker installation
Source: DigitalOcean benchmarks
3 Configure DNS

Point your domain (or subdomain like n8n.yourdomain.com) to your server's IP address. Create an A record in your DNS settings. This takes 5-30 minutes to propagate.

4 Create Docker Compose Configuration

Create the n8n directory and configuration:

# Create directory structure
mkdir -p /opt/n8n
cd /opt/n8n

# Create docker-compose.yml
nano docker-compose.yml

Paste this production-ready configuration:

version: '3.8'

services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - GENERIC_TIMEZONE=America/New_York
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your-secure-password
    volumes:
      - n8n_data:/home/node/.n8n

  caddy:
    image: caddy:latest
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

volumes:
  n8n_data:
  caddy_data:
  caddy_config:
Security Note: Replace your-secure-password with a strong, unique password. Never use default credentials in production.
5 Configure Caddy for Automatic SSL

Create the Caddyfile for automatic HTTPS:

# Create Caddyfile
nano Caddyfile

Add this configuration (replace with your domain):

n8n.yourdomain.com {
    reverse_proxy n8n:5678
}

Caddy automatically provisions and renews SSL certificates from Let's Encrypt—zero configuration required.

6 Launch n8n

Start the containers:

# Start n8n and Caddy
docker-compose up -d

# Check status
docker-compose ps

# View logs (optional)
docker-compose logs -f n8n

Visit https://n8n.yourdomain.com — you should see the n8n login screen. Use the credentials from your docker-compose.yml to log in.

92%
Success rate for first-time n8n Docker deployments
Source: n8n community forums, 2025

Security Hardening: Protecting Your Instance

Your n8n instance will handle sensitive data and API credentials. These security measures are essential:

1. Configure UFW Firewall

# Enable firewall
ufw allow ssh
ufw allow 80
ufw allow 443
ufw enable

# Verify rules
ufw status

2. Create Non-Root User

# Create user
adduser n8nuser
usermod -aG docker n8nuser

# Switch to new user for future operations
su - n8nuser

3. Enable Automatic Security Updates

apt install unattended-upgrades -y
dpkg-reconfigure -plow unattended-upgrades

For production deployments processing customer data, consider our guide on AI security tools for small businesses.

Automated Backups: Protecting Your Workflows

Losing workflows means losing hours of work. Set up automated backups:

# Create backup script
nano /opt/n8n/backup.sh

Add this script:

#!/bin/bash
DATE=$(date +%Y-%m-%d)
BACKUP_DIR=/opt/n8n/backups

# Create backup directory
mkdir -p $BACKUP_DIR

# Backup n8n data volume
docker run --rm -v n8n_n8n_data:/data -v $BACKUP_DIR:/backup \
  ubuntu tar cvf /backup/n8n-backup-$DATE.tar /data

# Keep only last 7 days
find $BACKUP_DIR -name "*.tar" -mtime +7 -delete

echo "Backup completed: n8n-backup-$DATE.tar"
# Make executable
chmod +x /opt/n8n/backup.sh

# Schedule daily backup at 3 AM
crontab -e
# Add this line:
0 3 * * * /opt/n8n/backup.sh
23%
of solopreneurs who lose automation data don't have backups
Source: Automation community survey, 2024

Updating n8n: Staying Current

n8n releases updates frequently with new integrations and bug fixes. Update safely:

# Navigate to n8n directory
cd /opt/n8n

# Pull latest images
docker-compose pull

# Restart with new version
docker-compose up -d

# Verify version
docker-compose logs n8n | grep "Version"

Pro tip: Check the n8n changelog before updating to review breaking changes.

Troubleshooting Common Issues

Webhooks Not Receiving Data

Ensure your WEBHOOK_URL environment variable matches your actual domain with HTTPS. Restart containers after changes.

Container Keeps Restarting

# Check error logs
docker-compose logs n8n

# Common fix: insufficient memory
# Upgrade to 2GB RAM droplet

SSL Certificate Errors

Verify DNS is pointing to your server. Caddy needs ports 80 and 443 open. Check Caddy logs:

docker-compose logs caddy

Slow Performance

For heavy workflows, upgrade your server or optimize workflows. See our advanced workflow optimization guide.

Alternative Deployment Options

Not comfortable with server management? These platforms offer simpler deployments:

Railway (Easiest)

One-click deployment with $5 free credits monthly. Visit Railway, search for n8n template, click Deploy. Perfect for getting started.

Render

Similar to Railway with slightly better free tier. Automatic SSL and deploys from GitHub.

Coolify (Self-Hosted Heroku)

If you want the control of self-hosting with a nice UI, Coolify lets you manage Docker apps through a web interface.

Your First Self-Hosted Workflow

Test your deployment with a simple workflow:

  1. Create new workflow in n8n
  2. Add Webhook node (trigger)
  3. Add Set node (transform data)
  4. Add Respond to Webhook node (return response)
  5. Activate workflow
  6. Test the webhook URL with curl or your browser

Once verified, explore our AI integration guide for connecting ChatGPT and Claude to your workflows.

FAQ: n8n Self-Hosted Setup

How much does self-hosted n8n cost?

Self-hosted n8n is completely free (open-source). Your only costs are server hosting, typically $5-20/month on providers like DigitalOcean, Hetzner, or Railway. This compares to n8n Cloud's $20-50/month plans with execution limits.

What server specs do I need for n8n?

For solopreneurs, a VPS with 2GB RAM and 1 vCPU is sufficient for most workflows. If running heavy AI automations or processing large files, upgrade to 4GB RAM. Storage needs are minimal—10GB is usually enough.

Is self-hosted n8n hard to maintain?

With Docker, updates are simple: pull the new image and restart the container. Most maintenance is automated. Expect 15-30 minutes per month for updates and monitoring.

Can I migrate from n8n Cloud to self-hosted?

Yes. Export your workflows as JSON from n8n Cloud, then import them into your self-hosted instance. Credentials need to be re-entered for security reasons. The process takes about 30 minutes.

What's the best hosting provider for n8n?

For beginners, Railway or Render offer one-click deployments. For more control and lower costs, DigitalOcean ($6/mo) or Hetzner ($4/mo) provide excellent value.

Next Steps: Building Your Automation Stack

With n8n self-hosted and running, you're ready to build powerful automations without execution limits. Recommended next reads:

Your self-hosted n8n instance is now a powerful asset—treat it like the revenue-generating infrastructure it is.