n8n Self-Hosted: Complete Setup Tutorial for Solopreneurs
Deploy unlimited automations on your own server—save thousands yearly while maintaining full control
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.
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 |
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:
- A domain name — for SSL and professional webhook URLs
- A credit card — for cloud server signup (most offer free credits)
- 30 minutes to 2 hours — depending on your experience level
- Basic terminal comfort — copy-paste commands work fine
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.
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
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
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.
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:
your-secure-password with a strong, unique password. Never use default credentials in production.
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.
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.
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.
Get the Complete Security Checklist
Download our n8n security hardening checklist plus weekly automation tips.
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
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:
- Create new workflow in n8n
- Add Webhook node (trigger)
- Add Set node (transform data)
- Add Respond to Webhook node (return response)
- Activate workflow
- 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:
- AI Email Automation: Lead to Customer — automate your sales funnel
- Social Media Automation Strategy — schedule and repurpose content
- Content Repurposing: One Post, 10 Formats — maximize content ROI
- Lead Generation Automation Playbook — fill your pipeline automatically
Your self-hosted n8n instance is now a powerful asset—treat it like the revenue-generating infrastructure it is.