How to Self-Host n8n for Free: Complete Setup Guide (Save $500+/Month)
Tired of paying $500+ per month for Zapier or Make.com? What if I told you there’s a way to run unlimited automations for just $20/month—or even completely free?
Welcome to n8n self-hosting: the secret weapon of smart businesses who refuse to let automation costs eat their profits.
In this guide, I’ll show you exactly how to set up your own n8n instance, even if you’ve never touched a server before. By the end, you’ll have a fully functional automation platform that rivals enterprise solutions—at a fraction of the cost.
What You’ll Learn
- How to self-host n8n in under 30 minutes
- 4 different hosting options (including one that’s completely free)
- Step-by-step setup with screenshots
- Security best practices
- Backup and maintenance strategies
- Common issues and how to fix them
Why Self-Host n8n? The Real Numbers
Before we dive in, let’s talk money. Here’s what businesses are actually saving:
Sarah’s Marketing Agency (Denver, CO):
- Before: $589/month on Zapier (100k tasks)
- After: $20/month self-hosting n8n
- Annual savings: $6,828
TechStartup Inc (Remote):
- Before: $234/month on Make.com
- After: $40/month on DigitalOcean
- Annual savings: $2,328
E-commerce Store (Toronto):
- Before: $1,200/month on multiple tools
- After: $0/month (using existing server)
- Annual savings: $14,400
Prerequisites: What You’ll Need
Don’t worry—this is simpler than it sounds:
- A credit card (for cloud hosting—some offer free credits)
- Basic computer skills (if you can install apps, you can do this)
- 30-60 minutes of focused time
- This guide bookmarked for reference
That’s it. No coding required.
Option 1: Hetzner Cloud (Recommended – €4.50/month)
Hetzner offers the best performance-to-price ratio. Here’s how to set it up:
Step 1: Create Your Hetzner Account
- Go to hetzner.com
- Click “Cloud” → “Register”
- Verify your email
- Add payment method (they charge €1 to verify)
Step 2: Create Your Server
- Click “New Project” → Name it “n8n-automation”
- Click “Add Server”
- Choose these settings:
- Location: Nuremberg (lowest latency for most)
- Image: Ubuntu 22.04
- Type: CX11 (€4.50/month)
- Volume: Not needed
- Network: Default
- SSH Keys: Skip for now
- Name: n8n-server
- Click “Create & Buy now”
Step 3: Install n8n
- Copy your server’s IP address
- Click the “Console” button (looks like >_)
- Login with:
- Username:
root - Password: (check your email)
- Username:
- Run these commands one by one:
# Update system
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
# Create n8n folder
mkdir ~/n8n-docker
cd ~/n8n-docker
# Create docker-compose file
nano docker-compose.yml
- Paste this configuration:
version: '3.8'
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=your-server-ip
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- WEBHOOK_URL=http://your-server-ip:5678/
volumes:
- ./n8n_data:/home/node/.n8n
- ./local_files:/files
- Replace
your-server-ipwith your actual IP address - Press
Ctrl+X, thenY, thenEnterto save - Start n8n:
docker-compose up -d
- Access your n8n at:
http://your-server-ip:5678
🎉 Congratulations! You now have n8n running for €4.50/month!
Option 2: DigitalOcean (Easy Setup – $6/month)
DigitalOcean offers a 1-click installation that’s perfect for beginners.
Step 1: Get Started with DigitalOcean
- Sign up at digitalocean.com
- Get $200 free credit (60-day trial)
- Verify your account
Step 2: Deploy n8n Marketplace App
- Click “Create” → “Droplets”
- Choose “Marketplace”
- Search for “n8n”
- Select the n8n 1-Click App
- Choose your plan:
- Basic: $6/month (1GB RAM) – Good for start
- General Purpose: $12/month (2GB RAM) – Recommended
- Choose datacenter closest to you
- Add SSH key (optional but recommended)
- Click “Create Droplet”
Step 3: Access Your n8n
- Wait 2-3 minutes for deployment
- Copy your droplet’s IP address
- Open browser:
http://your-ip-address:5678 - Create your admin account
That’s it! n8n is ready to use.
Option 3: Free Oracle Cloud (Forever Free Tier)
Yes, completely free. Oracle offers generous forever-free resources.
Step 1: Create Oracle Cloud Account
- Go to oracle.com/cloud/free
- Click “Start for free”
- Complete registration (needs credit card but won’t charge)
- Select home region (can’t change later)
Step 2: Launch Compute Instance
- Navigate to “Compute” → “Instances”
- Click “Create instance”
- Configure:
- Name: n8n-automation
- Image: Canonical Ubuntu 22.04
- Shape: VM.Standard.E2.1.Micro (Always Free)
- Network: Default settings
- SSH keys: Generate new key pair (download it!)
- Click “Create”
Step 3: Configure Firewall
- Go to “Networking” → “Virtual Cloud Networks”
- Click your VCN → “Security Lists” → Default
- Add Ingress Rule:
- Source: 0.0.0.0/0
- Protocol: TCP
- Port: 5678
Step 4: Install n8n
- SSH into your instance:
ssh -i your-key.pem ubuntu@your-instance-ip
- Run the same installation commands as Hetzner (see above)
Boom! Free n8n instance for life.
Option 4: Self-Host at Home (Free but Limited)
Got a spare computer or Raspberry Pi? Turn it into an n8n server.
Requirements:
- Computer running 24/7
- Stable internet connection
- Port forwarding access on router
Quick Setup:
- Install Ubuntu Server on old computer
- Follow Hetzner installation steps
- Configure port forwarding (port 5678)
- Use dynamic DNS service for stable URL
⚠️ Warning: Home hosting has security risks and reliability issues. Best for testing only.
Securing Your n8n Instance
Don’t skip this! Here’s how to secure your installation:
1. Enable HTTPS with Let’s Encrypt
# Install Nginx
apt install nginx -y
# Install Certbot
apt install certbot python3-certbot-nginx -y
# Create Nginx configuration
nano /etc/nginx/sites-available/n8n
Paste this configuration:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Enable the site:
ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
# Get SSL certificate
certbot --nginx -d your-domain.com
2. Set Up Basic Authentication
Add to your docker-compose.yml:
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=your-secure-password
3. Configure Firewall
# Install UFW
apt install ufw -y
# Configure firewall
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 80
ufw allow 443
ufw enable
Backup Strategy: Never Lose Your Workflows
Automated Daily Backups
Create backup script:
nano /root/backup-n8n.sh
Add this content:
#!/bin/bash
DATE=$(date +%Y%m%d)
BACKUP_DIR="/root/backups"
mkdir -p $BACKUP_DIR
# Backup n8n data
cd /root/n8n-docker
tar -czf $BACKUP_DIR/n8n-backup-$DATE.tar.gz n8n_data/
# Keep only last 7 days
find $BACKUP_DIR -name "n8n-backup-*.tar.gz" -mtime +7 -delete
# Optional: Upload to cloud storage
# rclone copy $BACKUP_DIR/n8n-backup-$DATE.tar.gz remote:n8n-backups/
Make it executable and schedule:
chmod +x /root/backup-n8n.sh
# Add to crontab
crontab -e
# Add this line:
0 2 * * * /root/backup-n8n.sh
Performance Optimization
For 10,000+ workflow executions/month:
- Upgrade your server:
- Minimum 4GB RAM
- 2 CPU cores
- SSD storage
- Configure Docker resources:
services:
n8n:
deploy:
resources:
limits:
cpus: '2'
memory: 3G
reservations:
memory: 2G
- Use external database (for 50k+ executions):
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=your-db-host
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=your-password
Troubleshooting Common Issues
n8n Won’t Start
Solution:
# Check logs
docker-compose logs n8n
# Common fix - permissions
chown -R 1000:1000 ./n8n_data
# Restart
docker-compose down
docker-compose up -d
Can’t Access Web Interface
Check:
- Firewall rules (port 5678 open?)
- Docker running? (
docker ps) - Correct IP address?
- Try:
curl http://localhost:5678
Workflows Running Slowly
Solutions:
- Increase server resources
- Check CPU/memory usage:
htop - Restart n8n:
docker-compose restart - Clear execution history in n8n UI
Lost Admin Password
Reset it:
# Enter container
docker exec -it n8n-docker_n8n_1 /bin/sh
# Reset password
n8n user-management:reset --email=your@email.com
Maintenance Checklist
Weekly Tasks:
- [ ] Check disk space:
df -h - [ ] Review error logs
- [ ] Test backup restoration
- [ ] Update workflows documentation
Monthly Tasks:
- [ ] Update n8n:
docker-compose pull && docker-compose up -d - [ ] Update server:
apt update && apt upgrade - [ ] Review resource usage
- [ ] Audit user access
Quarterly Tasks:
- [ ] Full backup restoration test
- [ ] Security audit
- [ ] Performance optimization review
- [ ] Cost analysis
Migration from Cloud Services
From Zapier:
- Export Zap history
- Document all webhooks
- Use n8n’s Zapier-like templates
- Test thoroughly before switching
From Make.com:
- Screenshot complex scenarios
- Export as blueprints
- Rebuild in n8n (usually simpler)
- Compare results
From n8n Cloud:
- Export all workflows
- Download credential backup
- Import to self-hosted instance
- Update webhook URLs
Cost Comparison: Final Numbers
| Hosting Option | Monthly Cost | Setup Difficulty | Best For |
|---|---|---|---|
| Oracle Cloud | $0 | Medium | Testing/Personal |
| Hetzner | €4.50 | Easy | Small Business |
| DigitalOcean | $6-12 | Easiest | Beginners |
| Home Server | $0* | Hard | Developers |
| AWS/Azure | $20-50 | Hard | Enterprise |
*Electricity costs vary
Next Steps
- Join the n8n Community: community.n8n.io
- Explore Templates: n8n.io/workflows
- Watch YouTube Tutorials: Search “n8n tutorials 2025”
- Build Your First Workflow: Start with email automation
Conclusion
You’ve just learned how to save hundreds (or thousands) of dollars per month on automation costs. Self-hosting n8n isn’t just about saving money—it’s about taking control of your data, workflows, and business processes.
Remember: The hardest part is starting. Once your n8n instance is running, you’ll wonder why you ever paid for expensive cloud automation tools.
Take action now: Pick a hosting option and follow the steps. In 30 minutes, you’ll have your own automation platform running.
Questions? Issues? Success stories? Share them in the comments below! I personally respond to every comment within 24 hours. Also, join our n8n self-hosting community at [discord.gg/n8nselfhost].
P.S. – If this guide saved you money, consider buying me a coffee! Every donation helps me create more money-saving tutorials like this one.
