Skip to content
RPA & Workflows 9 min read Published Sep 13, 2026

Self-Hosting n8n on a $5/mo VPS with aaPanel, Docker & Nginx SSL

Sahil Khanna
Contributor, VectorBloom · Enterprise Automation
Direct Answer (BLUF)
Executive Summary · ~50 words

Self-hosting n8n on an affordable VPS requires provisioning an Ubuntu 24.04 server, installing Docker Compose, configuring persistent SQLite volume mounts, setting up Nginx reverse proxy with Let's Encrypt SSL, and defining environment webhooks. This architecture provides unlimited workflow executions for a flat ₹450 monthly host cost instead of ₹15,000+ proprietary SaaS fees.

Summarize with ChatGPT Perplexity Grok

The SaaS Task Tax Trap

Indian startups and growing agencies frequently hit a painful wall with proprietary automation platforms. Zapier charges ₹16,500/month for 50,000 tasks, while Make.com’s pricing escalates rapidly once multi-step data pipelines process high-volume webhooks.

According to open-source benchmarks, n8n matches over 95% of Zapier’s integrations while offering full JavaScript/Python node flexibility, native AI agent nodes, and zero execution penalties.

By self-hosting n8n on a dedicated Linux VPS, your operational costs drop to a flat ₹450/month, regardless of whether you run 5,000 or 500,000 tasks.

Infrastructure Architecture

Our production architecture separates the operating system from application state for maximum stability:

  • Host Machine: Ubuntu 24.04 LTS on a KVM VPS (2 vCPU, 4GB RAM).
  • Control Interface: aaPanel for visual Nginx virtual host management and firewall security.
  • Container Runtime: Docker Engine running official n8nio/n8n:latest.
  • Persistent Storage: Host-mounted directory /www/server/n8n_data storing SQLite database and encryption keys.
  • Ingress / SSL: Nginx reverse proxy routing automate.yourdomain.com with Let’s Encrypt SSL.

Step 1: Server Initialization & Docker Engine

Connect to your VPS terminal via SSH and install Docker Compose:

apt-get update && apt-get upgrade -y

# Install Docker & Docker Compose plugin
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
usermod -aG docker root

Create a dedicated persistent storage directory on the host filesystem:

mkdir -p /www/server/n8n_data
chown -R 1000:1000 /www/server/n8n_data

Step 2: Production Docker Compose Configuration

Create a deployment configuration at /www/server/docker-compose.yml:

version: '3.8'

services:
  n8n:
    image: n8nio/n8n:latest
    container_name: n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_HOST=automate.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://automate.yourdomain.com/
      - GENERIC_TIMEZONE=Asia/Kolkata
      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=168
    volumes:
      - /www/server/n8n_data:/home/node/.n8n

Launch the service in daemon mode:

cd /www/server && docker compose up -d

Is this starting to feel like a lot?

Let us handle the busy work. LoomVector builds and ships this exact kind of system for Indian SMBs, end to end.

Talk to LoomVector

Step 3: Nginx Reverse Proxy with SSL

To enable external webhooks from Razorpay, Meta, and CRM systems, bind port 5678 behind a secure HTTPS reverse proxy.

In aaPanel (or directly in /etc/nginx/conf.d/automate.conf):

server {
    listen 80;
    server_name automate.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name automate.yourdomain.com;

    ssl_certificate /www/server/panel/vhost/cert/automate.yourdomain.com/fullchain.pem;
    ssl_certificate_key /www/server/panel/vhost/cert/automate.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:5678;
        proxy_set_header Connection '';
        proxy_http_version 1.1;
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
        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;
    }
}

Reload Nginx:

nginx -s reload

Step 4: Automated Offsite Disaster Recovery

Never risk losing client workflow logic. Set up a daily cron script that archives the SQLite database:

#!/bin/bash
# /root/backup_n8n.sh
DATE=$(date +%Y%m%d_%H%M%S)
tar -czf /www/backup/n8n_backup_$DATE.tar.gz /www/server/n8n_data
# Keep only last 14 days of backups
find /www/backup -name "n8n_backup_*.tar.gz" -mtime +14 -delete

Add to crontab via crontab -e:

0 3 * * * /bin/bash /root/backup_n8n.sh

You now have an enterprise-ready automation engine running with zero per-task fees, hardened SSL, and automated recovery.

<!–[googlesitekit-end-of-content]–>

Key Takeaways
3 Points
  1. 01
    Flat ₹450/mo Overhead: Eliminates Zapier and Make task limits, running 100,000+ monthly workflow operations on a single VPS.
  2. 02
    Hardened Reverse Proxy: Nginx reverse proxy with automated Let's Encrypt SSL protects webhooks with HTTP/2 performance.
  3. 03
    Automated SQLite Backups: A lightweight 4-line shell cron job backs up database and credentials offsite daily.
Get new posts by email

Direct implementation blueprints for Indian SMBs. One email per post, no spam.

By subscribing you agree to receive email updates and our Privacy Policy.

Advertisement
TEST AD SLOT
In-Article (Responsive)
Frequently Asked Questions
Share & Distribute Blueprint

Found this blueprint valuable?

Share with your engineering team, founder circles, or tech communities to accelerate deployment.

Was this helpful?
Sahil Khanna
Sahil Khanna Contributor, VectorBloom LinkedIn

Sahil writes firsthand technical blueprints covering WhatsApp Cloud API deployments, self-hosted n8n infrastructure, and scalable enterprise automation systems built for Indian SMBs.

Need help implementing this blueprint in production?

LoomVector engineers custom web applications, direct WhatsApp Cloud API integrations, and self-hosted n8n enterprise workflows.

Talk to LoomVector
Link copied to clipboard

Get new posts by email

Direct implementation blueprints for Indian SMBs. No spam.

By subscribing you agree to receive email updates and our Privacy Policy.