Cara Menjalankan n8n di VPS Lokal, Cloud, atau Gratisan

Jawaban singkat: 3 opsi menjalankan n8n — (1) VPS Cloud (DigitalOcean, Vultr, Contabo, Lokal Indonesia) — produksi, kontrol penuh, (2) n8n Cloud (Managed) — zero maintenance, trial 14 hari, (3) Gratisan: n8n Cloud Free Tier / GitHub Codespaces / Railway / Render / Localhost — belajar & test. Artikel ini setup step-by-step semua opsi, biaya, kelebihan/kekurangan, dan checklist produksi.

Perbandingan 3 Opsi Menjalankan n8n

Aspek VPS Cloud (Self-Hosted) n8n Cloud (Managed) Gratisan (Free Tier / Trial)
Kontrol Penuh (Root access, custom everything) Terbatas (Managed, tidak root) Terbatas (Environment mereka)
Biaya/Bulan Rp 60-300rb (VPS 2-8GB RAM) $20-120/bln (Rp 300rb-1,8jt) Rp 0
Executions Unlimited Terikat plan (2.5k – 100k/bln) Terbatas (100-1k/bln)
Data Ownership 100% Anda (VPS Anda) Di server n8n (EU/US) Di server provider
Maintenance Anda (Update, Backup, Security, Monitoring) Zero (Managed by n8n) Provider (tapi bisa dihapus kapan saja)
Custom Domain + SSL Bebas (Domain Anda, SSL Let’s Encrypt/Cloudflare) Custom domain included (plan Pro+) Subdomain provider (tidak custom domain)
Webhook URL Domain Anda (WhatsApp API Resmi ready) Subdomain n8n.cloud (OK untuk API Resmi) Subdomain provider (sering tidak valid untuk API Resmi)
Skala Unlimited (Upgrade VPS / Cluster) Terikat plan (Enterprise custom) Tidak untuk produksi
Cocok Untuk Produksi UMKM – Enterprise Non-teknis, budget >Rp 3jt/bln, zero maintenance Belajar, Test, Demo, Development

Rekomendasi 2026: **VPS Cloud Self-Hosted** untuk produksi (hemat, kontrol, scale). n8n Cloud untuk non-teknis yang mau bayar premium. Gratisan untuk belajar 2 minggu → migrasi ke VPS.

Opsi 1: VPS Cloud Self-Hosted (Produksi – Rekomendasi Utama)

Pilih Provider VPS (2026 Terbaik untuk Indonesia)

Provider Spec Populer Harga/Bulan Lokasi Server Kelebihan
Contabo VPS M: 4 vCPU, 8GB RAM, 200GB SSD ~Rp 150rb (€8.49) Jerman, Singapura, US Price/performance terbaik, RAM besar murah
Vultr Regular: 2 vCPU, 4GB RAM, 80GB SSD ~Rp 150rb ($10) Singapura, Jakarta, Sydney Latency rendah ke Indonesia, UI bagus
DigitalOcean Basic: 2 vCPU, 4GB RAM, 80GB SSD ~Rp 300rb ($20) Singapura Managed Database, Kubernetes, Docs terbaik
CloudKilat / Dewaweb / Niagahoster Cloud VPS: 2-4 vCPU, 4-8GB RAM Rp 100-250rb Indonesia (Jakarta) Latency terendah, Support Bahasa Indonesia, Pembayaran Lokal
AWS Lightsail / Google Cloud / Azure 2 vCPU, 4GB RAM Rp 300-500rb Singapura/Jakarta Enterprise grade, Integrated services

Spec Minimum Produksi: 2 vCPU, 4GB RAM, 50GB SSD, Ubuntu 22.04/24.04 LTS. Recommended: 4 vCPU, 8GB RAM, 100GB+ SSD (handle volume 10k+ chat/bln + Redis + PostgreSQL).

Setup VPS n8n (Script Otomatis 1 Baris – 5 Menit)

  1. Beli VPS → Dapatkan IP, Username (root), Password/SSH Key
  2. SSH ke VPS: `ssh root@IP_VPS`
  3. Jalankan Script Install Otomatis:
# Script install n8n + Docker + Nginx + SSL (Let’s Encrypt) + Auto-restart
# Jalankan sebagai root di VPS baru Ubuntu 22.04/24.04

bash <(curl -sSL https://raw.githubusercontent.com/n8n-io/n8n-hosting/main/scripts/install.sh) \ --domain "domain-anda.com" \ --email "email-anda@domain.com" \ --timezone "Asia/Jakarta" \ --n8n-version "latest" \ --postgres "true" \ --redis "true" \ --backup-schedule "daily"

Atau Manual Step-by-Step (Untuk Paham Apa yang Terjadi):

  1. Update & Install Dependencies:
    `apt update && apt upgrade -y && apt install -y curl wget git ufw fail2ban htop nginx certbot python3-certbot-nginx docker.io docker-compose-plugin`
  2. Setup Firewall & Security:
    `ufw allow 22/tcp && ufw allow 80/tcp && ufw allow 443/tcp && ufw –force enable`
    `fail2ban-client status sshd` (pastikan aktif)
  3. Buat Directory n8n:
    `mkdir -p /opt/n8n/{data,postgres,redis,backups} && chown -R 1000:1000 /opt/n8n/data`
  4. Docker Compose (Simpan di `/opt/n8n/docker-compose.yml`):
version: ‘3.8’
services:
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
– “127.0.0.1:5678:5678”
environment:
– N8N_HOST=${DOMAIN}
– N8N_PORT=5678
– N8N_PROTOCOL=https
– NODE_ENV=production
– WEBHOOK_URL=https://${DOMAIN}/
– GENERIC_TIMEZONE=Asia/Jakarta
– N8N_BASIC_AUTH_ACTIVE=true
– N8N_BASIC_AUTH_USER=admin
– N8N_BASIC_AUTH_PASSWORD=${STRONG_PASSWORD}
– DB_TYPE=postgresdb
– DB_POSTGRESDB_HOST=postgres
– DB_POSTGRESDB_PORT=5432
– DB_POSTGRESDB_DATABASE=n8n
– DB_POSTGRESDB_USER=n8n
– DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
– EXECUTIONS_MODE=queue
– QUEUE_BULL_REDIS_HOST=redis
– QUEUE_BULL_REDIS_PORT=6379
volumes:
– ./data:/home/node/.n8n
depends_on:
– postgres
– redis
healthcheck:
test: [“CMD”, “wget”, “-q”, “–spider”, “http://localhost:5678/healthz”]
interval: 30s
timeout: 10s
retries: 3

postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
– POSTGRES_DB=n8n
– POSTGRES_USER=n8n
– POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
– ./postgres:/var/lib/postgresql/data
healthcheck:
test: [“CMD-SHELL”, “pg_isready -U n8n -d n8n”]
interval: 10s
timeout: 5s
retries: 5

redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
– ./redis:/data
healthcheck:
test: [“CMD”, “redis-cli”, “ping”]
interval: 10s
timeout: 5s
retries: 5

nginx:
image: nginx:alpine
restart: unless-stopped
ports:
– “80:80”
– “443:443”
volumes:
– ./nginx/conf.d:/etc/nginx/conf.d:ro
– ./certbot/conf:/etc/letsencrypt:ro
– ./certbot/www:/var/www/certbot:ro
depends_on:
– n8n

  1. Nginx Config (`/opt/n8n/nginx/conf.d/n8n.conf`):
server {
listen 80;
server_name ${DOMAIN};
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl http2;
server_name ${DOMAIN};
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
location / {
proxy_pass http://n8n:5678;
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;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
client_max_body_size 50M;
}
}
  1. Buat File `.env` di `/opt/n8n/`:
DOMAIN=domain-anda.com
POSTGRES_PASSWORD=generate_strong_password_32_char
N8N_BASIC_AUTH_PASSWORD=generate_strong_password_32_char
  1. Jalankan:
    `cd /opt/n8n && docker compose up -d`
    Tunggu 30-60 detik → Cek: `docker compose ps` (semua Up healthy)
  2. SSL Certificate (Let’s Encrypt via Certbot):
    `docker run –rm -v /opt/n8n/certbot/conf:/etc/letsencrypt -v /opt/n8n/certbot/www:/var/www/certbot certbot/certbot certonly –webroot -w /var/www/certbot -d ${DOMAIN} –email email-anda@domain.com –agree-tos –no-eff-email –force-renewal`
    Reload Nginx: `docker compose exec nginx nginx -s reload`
  3. Auto-renewal SSL (Cron):
    `echo “0 3 * * * root docker run –rm -v /opt/n8n/certbot/conf:/etc/letsencrypt -v /opt/n8n/certbot/www:/var/www/certbot certbot/certbot renew –quiet && docker compose -f /opt/n8n/docker-compose.yml exec nginx nginx -s reload” > /etc/cron.d/certbot-renew`

Opsi 2: n8n Cloud (Managed – Zero Maintenance)

  • Daftar: n8n.cloud → Trial 14 hari (Full features)
  • Pilih Plan: Starter $20/bln (2.5k executions), Pro $50/bln (10k), Team $120/bln (50k)
  • Custom Domain: Plan Pro+ (Settings → Custom Domain → CNAME ke n8n.cloud)
  • Webhook URL: `https://domain-anda.app.n8n.cloud/webhook/…` (Valid untuk API Resmi)
  • Keuntungan: Zero setup, auto-update, auto-backup, auto-scale, SLA 99.9%
  • Kekurangan: Biaya per execution, data di n8n, lock-in, custom node terbatas

Opsi 3: Gratisan (Belajar & Test 2 Minggu)

Platform Cara Batasan Cocok Untuk
n8n Cloud Free Tier Daftar n8n.cloud → Pilih Free 100 executions/bln, 1 workflow, no custom domain, no webhook publik Belajar UI, logic, test AI prompt
GitHub Codespaces Fork n8n repo → Open in Codespaces 60 jam/bln gratis, sleep 30 menit idle, tidak persist webhook Development, test custom node, PR
Railway.app Deploy n8n template → $5 credit/bln $5/bln = ~100k executions, sleep jika tidak dipakai, custom domain gratis Test produksi-like, demo klien
Render.com Deploy n8n Docker → Free tier Sleep 15 menit idle, 750 jam/bln, custom domain gratis Test webhook, demo singkat
Localhost (Laptop Anda) Docker: `docker run -it –rm -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n` Hanya lokal, tidak bisa webhook publik (kecuali ngrok/cloudflare tunnel) Development offline, belajar gratis total
ngrok / Cloudflare Tunnel Expose localhost ke internet ngrok Free: URL random tiap restart, 40 koneksi/menit. Cloudflare Tunnel: Gratis, custom domain, unlimited Test webhook WhatsApp API Resmi dari localhost

Checklist Produksi VPS (Wajib Sebelum Launch)

  • [ ] VPS: 2 vCPU, 4GB+ RAM, 50GB+ SSD, Ubuntu 22.04/24.04
  • [ ] Domain + DNS A Record → IP VPS
  • [ ] Docker + Docker Compose + Nginx + Certbot installed
  • [ ] docker-compose.yml: n8n + PostgreSQL + Redis + Nginx
  • [ ] .env: DOMAIN, POSTGRES_PASSWORD, N8N_BASIC_AUTH_PASSWORD (generate strong!)
  • [ ] Nginx Config: Proxy pass ke n8n:5678, WebSocket support, SSL ready
  • [ ] SSL Let’s Encrypt: Certbot certonly webroot → Auto-renewal cron
  • [ ] Basic Auth n8n: N8N_BASIC_AUTH_ACTIVE=true, User/Pass strong
  • [ ] Firewall: UFW allow 22,80,443 only. Fail2ban SSH active.
  • [ ] Backup Cron Daily: `docker compose exec postgres pg_dump -U n8n n8n > /opt/n8n/backups/n8n_$(date +%F).sql` + tar data folder → Upload ke Drive/S3/GitHub
  • [ ] Monitoring: UptimeRobot (webhook URL), Netdata (VPS metrics), Telegram Alert (Error Trigger + Daily Health)
  • [ ] Health Check: `curl -f https://domain-anda.com/healthz` → 200 OK
  • [ ] WhatsApp Webhook Test: Kirim chat → n8n Execution sukses
  • [ ] Load Test: 100 chat bersamaan → Response <2 detik, RAM <80%, CPU <70%

Backup & Disaster Recovery (Wajib Produksi)

Komponen Frekuensi Method Retensi
PostgreSQL (Workflow, Credentials, Executions) Daily 03:00 `pg_dump` → compress → Upload Drive/S3/GitHub Private 30 hari daily, 12 bulan monthly
n8n Data Folder (Binary files, Custom nodes) Daily 03:30 `tar czf` → Upload 30 hari
Redis (Queue – optional, bisa rebuild) Weekly `redis-cli BGSAVE` → Copy dump.rdb 4 minggu
Full VPS Snapshot Weekly Provider Dashboard (Vultr/DO/Contabo: Free/cheap) 4 minggu

Recovery Test: Bulanan: Restore ke VPS baru / Local Docker → Verify n8n jalan, workflow intact, credentials work.

FAQ: Menjalankan n8n di VPS, Cloud, atau Gratisan

Berapa biaya VPS produksi n8n per bulan untuk UMKM?

Rp 150-300rb/bln (Contabo/Vultr 4GB RAM / CloudKilat 4-8GB RAM). Termasuk: VPS, Domain Rp 15rb, SSL Gratis, Backup Gratis (Drive/GitHub). Total

Apakah n8n Cloud Free Tier cukup untuk bot WhatsApp produksi kecil?

TIDAK — 100 executions/bln terlalu kecil (bot FAQ 500 chat/bln = ~5.000 executions). Cocok hanya untuk belajar UI & logic 2 minggu. Produksi: VPS Self-Hosted.

Bisakah n8n jalan di shared hosting / cPanel?

TIDAK — n8n butuh Node.js runtime, Docker, WebSocket, background processes, custom ports. Shared hosting tidak support. Butuh VPS / Cloud / Dedicated / Container Platform (Railway, Render, Fly.io, Kubernetes).

Bagaimana handle update n8n versi baru di VPS?

Docker: `cd /opt/n8n && docker compose pull && docker compose up -d` (zero downtime, rolling update). Atau Watchtower auto-update: `docker run -d –name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower –schedule “0 4 * * *” n8n`. Backup dulu sebelum update.

Template setup VPS lengkap sudah jadi di mana?

Ebook + Template n8n — include: Script install otomatis 1 baris, docker-compose.yml production ready, Nginx + SSL config, .env template, Backup script, Monitoring setup (UptimeRobot + Netdata + Telegram), Firewall + Fail2ban config, Load test script, Disaster recovery guide, Update & maintenance SOP.

Baca juga: Cara Menjalankan n8n di VPS Lokal, Cloud, atau Gratisan untuk panduan lengkapnya.

Scroll to Top