🚀 Free Hosting

How to Host n8n on Server Free: Step-by-Step Guide 2026

Prashant Lalwani
15 min readHostingTutorialn8n

Learn how to host n8n on server free with this complete step-by-step guide. Deploy n8n workflow automation on free cloud platforms like Oracle Cloud, Railway, and Render without spending a dime. This tutorial covers Docker setup, database configuration, SSL certificates, and production deployment best practices.

🎯 Why Self-Host n8n? Save $20-200/month on cloud subscriptions. Get unlimited workflow executions, complete data privacy, and full control over your automation infrastructure. Perfect for businesses and developers who want enterprise-grade automation without enterprise costs.

n8n self-hosting setup on free cloud server with Docker configuration

Why Host n8n for Free?

Self-hosting n8n gives you complete control over your automation workflows while eliminating monthly subscription costs. Here's what you get:

Featuren8n CloudSelf-Hosted (Free)
Monthly Cost$20-$200+$0 (free tier)
Workflow ExecutionsLimited by planUnlimited
Data PrivacyCloud storageYour server
Custom IntegrationsLimitedFull access
Uptime Control99.9%100% control

Prerequisites

  • Basic understanding of command line/terminal
  • Git installed on your computer
  • Docker Desktop installed (for local testing)
  • Free cloud account (Oracle Cloud, Railway, or Render)
  • Domain name (optional, for custom URL)

Method 1: Oracle Cloud Free Tier (Recommended)

Step 1: Create Oracle Cloud Account

  1. Sign up at cloud.oracle.com
  2. Choose "Always Free" resources
  3. Verify your account (credit card required for verification, but no charges)
  4. Create an OCI compartment for organization

Step 2: Launch VM Instance

  1. Navigate to Compute → Instances
  2. Click "Create Instance"
  3. Choose Ubuntu 22.04 image
  4. Select VM.Standard.E2.1.Micro (Always Free)
  5. Add SSH key (generate new or use existing)
  6. Click "Create"
Oracle Cloud n8n Deployment Flow
☁️ Oracle Cloud Free VM
🐳 Docker Container
🔧 n8n Automation
🌐 Public IP Access

Step 3: Install Docker

Connect to your VM via SSH and run:

Docker Installation Commands Terminal

ssh -i ~/.ssh/your-key ubuntu@your-vm-ip
sudo apt update && sudo apt upgrade -y
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker

Step 4: Deploy n8n with Docker

Create a docker-compose.yml file:

Docker Compose Configuration

version: '3.8'
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=your-secure-password
- WEBHOOK_URL=https://your-domain.com
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:

Step 5: Start n8n

Run the deployment:

docker-compose up -d
docker-compose logs -f

Method 2: Railway (Simplest)

Step 1: Create Railway Account

  1. Go to railway.app
  2. Sign up with GitHub
  3. Get $5 free credit (no credit card required)

Step 2: Deploy n8n Template

  1. Click "New Project"
  2. Select "Deploy from GitHub repo"
  3. Use n8n's official template
  4. Add PostgreSQL database
  5. Configure environment variables

Railway Environment Variables Config

GENERIC_TIMEZONE=UTC
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=your-password
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=${{postgres.POSTGRES_HOST}}
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_USER=${{postgres.POSTGRES_USER}}
DB_POSTGRESDB_PASSWORD=${{postgres.POSTGRES_PASSWORD}}
DB_POSTGRESDB_DATABASE=${{postgres.POSTGRES_DB}}

Method 3: Render (Alternative)

Step 1: Create Render Account

  1. Visit render.com
  2. Sign up with GitHub
  3. Free tier includes 750 hours/month

Step 2: Create Web Service

  1. Click "New" → "Web Service"
  2. Connect your GitHub repository
  3. Choose Docker as environment
  4. Set instance type to "Free"
  5. Add PostgreSQL database

Security Configuration

Enable HTTPS with Let's Encrypt

For production deployments, always use HTTPS:

Certbot Installation

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d your-domain.com
sudo certbot renew --dry-run

Firewall Configuration

Secure your server with firewall rules:

  • Oracle Cloud: Configure Security Lists to allow only ports 22, 80, 443
  • Ubuntu UFW: sudo ufw allow 22 && sudo ufw allow 5678 && sudo ufw enable

Database Setup

For production, use PostgreSQL instead of SQLite:

DatabaseBest ForSetup Complexity
SQLiteTesting/DevelopmentEasy (built-in)
PostgreSQLProductionMedium
MySQLProductionMedium

Backup Strategy

Automated Backups:

✅ Set up cron jobs for daily database dumps
✅ Backup n8n_data volume regularly
✅ Store backups in cloud storage (S3, Google Drive)
✅ Test restore procedures monthly

Performance Optimization

Resource Allocation

  • Minimum: 1GB RAM, 1 vCPU
  • Recommended: 2GB RAM, 2 vCPU
  • High Volume: 4GB+ RAM, 4+ vCPU

Environment Variables for Performance

EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
WEBHOOK_TIMEOUT=30000

Troubleshooting Common Issues

Issue: Container Won't Start

Solution: Check Docker logs with docker-compose logs n8n and verify port 5678 isn't in use.

Issue: Webhooks Not Working

Solution: Ensure WEBHOOK_URL environment variable is set correctly and firewall allows inbound traffic.

Issue: Database Connection Errors

Solution: Verify database credentials and ensure PostgreSQL is running: docker-compose ps

Monitoring & Maintenance

  • Update n8n: docker-compose pull && docker-compose up -d
  • Check logs: docker-compose logs -f
  • Monitor resources: Use htop or docker stats
  • SSL renewal: Certbot auto-renews, verify with certbot certificates

Cost Breakdown

PlatformMonthly CostResourcesBest For
Oracle Cloud$0 (Always Free)1GB RAM, 1 vCPULong-term projects
Railway$0 (with $5 credit)512MB RAMQuick deployment
Render$0 (750 hrs/month)512MB RAMTesting/Development
VPS (DigitalOcean)$5-10/month1-2GB RAMProduction

Conclusion

Hosting n8n on server free is entirely possible with these methods. Oracle Cloud offers the best long-term solution with always-free resources, while Railway and Render provide quick deployment options. Follow the security best practices, set up regular backups, and you'll have enterprise-grade workflow automation running 24/7 at zero cost.

Ready to build automations? Check out our guides on n8n workflow examples for beginners and free n8n automation ideas to start automating your business.

Found this hosting guide helpful? Share it! 🚀

Twitter/X LinkedIn