🚀 Deployment Options Overview
Trước khi deploy n8n, bạn cần hiểu các options và trade-offs. Bài này sẽ giúp bạn chọn đúng strategy cho use case của mình.
Deployment Options Matrix
Quick Comparison:
| Option | Setup Time | Cost | Control | Scale | Best For |
|---|---|---|---|---|---|
| n8n Cloud | 5 min | $$$$ | Low | Auto | Quick start |
| Railway | 15 min | $$ | Medium | Manual | Side projects |
| Docker VPS | 1-2 hr | $$ | High | Manual | Production |
| Kubernetes | 4-8 hr | $$$ | Highest | Auto | Enterprise |
Option 1: n8n Cloud
Pros & Cons:
Text
1✅ PROS:2• Zero setup/maintenance3• Auto updates4• Built-in auth5• Team features included6• Support available7 8❌ CONS:9• Highest cost ($20-500/mo)10• Limited customization11• Data on n8n servers12• Execution limits13• No source accessWhen to Use:
- Trying n8n first time
- Don't want ops overhead
- Budget isn't constraint
- Need enterprise features fast
Pricing (2024):
Text
1STARTER: $20/mo2• 2,500 executions3• 1 user4 5PRO: $50/mo6• 10,000 executions7• 5 users8 9ENTERPRISE: Custom10• Unlimited executions11• SSO, audit logsOption 2: Platform-as-a-Service (PaaS)
Platforms:
Text
1RAILWAY2├── Easy Docker deployment3├── $5-20/mo typical4├── Auto-sleep (free tier)5└── Good for dev/staging6 7RENDER8├── Free tier available9├── $7/mo starter10├── Web service + PostgreSQL11└── Decent free tier12 13HEROKU (via Docker)14├── Established platform15├── $7-25/mo16├── Eco dyno sleeps17└── Good addons marketplace18 19DIGITALOCEAN APP PLATFORM20├── Simple interface21├── $12/mo minimum22├── Easy database attach23└── Predictable pricingBest Choice: Railway
Text
1WHY RAILWAY:2• One-click n8n template3• Built-in PostgreSQL4• Environment variables UI5• Cheap for small scale6• Good developer experience7 8LIMITATION:9• Sleep after inactivity (free)10• Less control than VPS11• Costs grow with usageOption 3: Self-Hosted VPS
Popular VPS Providers:
Text
1PROVIDER MIN COST BEST FOR2─────────────────────────────────────3Hetzner $4/mo Best value4DigitalOcean $6/mo Good docs5Vultr $6/mo Many regions6Linode $5/mo Reliable7AWS Lightsail $5/mo AWS ecosystemRecommended Specs:
Text
1SMALL (Personal)2• 1 vCPU, 2GB RAM3• 40GB SSD4• $5-10/mo5• 100-500 exec/day6 7MEDIUM (Team)8• 2 vCPU, 4GB RAM9• 80GB SSD10• $15-25/mo11• 500-5000 exec/day12 13LARGE (Production)14• 4 vCPU, 8GB RAM15• 160GB SSD16• $40-60/mo17• 5000+ exec/dayWhy Self-Host:
Text
1✅ BENEFITS:2• Full control over data3• Lower cost at scale4• Custom configurations5• No execution limits6• Install any node7 8⚠️ REQUIREMENTS:9• Linux/Docker knowledge10• Time for maintenance11• Backup responsibility12• Security managementOption 4: Kubernetes
When K8s Makes Sense:
Text
1✅ USE K8S IF:2• Need high availability3• 10,000+ executions/day4• Multiple n8n instances5• Existing K8s infrastructure6• Auto-scaling required7 8❌ SKIP K8S IF:9• Just starting out10• Small team11• Limited ops capacity12• Budget-consciousK8s Components Needed:
Text
1N8N ON KUBERNETES2─────────────────3 4┌──────────────────────────────────┐5│ INGRESS │6│ (nginx/traefik) │7└─────────────┬────────────────────┘8 │9┌─────────────┴────────────────────┐10│ N8N DEPLOYMENT │11│ ┌──────┐ ┌──────┐ │12│ │ Pod1 │ │ Pod2 │ (HPA) │13│ └──────┘ └──────┘ │14└─────────────┬────────────────────┘15 │16┌─────────────┴────────────────────┐17│ PERSISTENT STORAGE │18│ PostgreSQL / Redis (Queue) │19└──────────────────────────────────┘Architecture Comparison
Simple Setup (VPS):
Text
1┌─────────────────────────────────────┐2│ VPS │3│ ┌─────────────────────────────┐ │4│ │ Docker │ │5│ │ ┌─────┐ ┌──────┐ │ │6│ │ │ n8n │──│Postgres│ │ │7│ │ └──┬──┘ └───────┘ │ │8│ │ │ │ │9│ │ ┌──┴───┐ │ │10│ │ │Nginx │←── HTTPS │ │11│ │ └──────┘ │ │12│ └─────────────────────────────┘ │13└─────────────────────────────────────┘Production Setup:
Text
1┌────────────────────────────────────────────┐2│ PRODUCTION STACK │3│ │4│ CDN/WAF │5│ │ │6│ Load Balancer │7│ │ │8│ ┌──┴───┬───────┐ │9│ │ │ │ │10│ n8n-1 n8n-2 n8n-3 (Queue Mode) │11│ │ │ │ │12│ └──┬───┴───────┘ │13│ │ │14│ ┌──┴────────────────────────┐ │15│ │ PostgreSQL (Primary) │ │16│ │ Redis (Queue/Session) │ │17│ │ S3 (Binary storage) │ │18│ └────────────────────────────┘ │19└────────────────────────────────────────────┘Decision Framework
Questions to Ask:
Text
11. BUDGET2 └── <$20/mo → PaaS/Small VPS3 └── $20-100/mo → VPS self-host4 └── $100+/mo → Consider n8n Cloud or K8s5 62. TECHNICAL SKILL7 └── Beginner → n8n Cloud8 └── Can use CLI → PaaS9 └── Docker comfortable → VPS10 └── DevOps team → Kubernetes11 123. DATA SENSITIVITY13 └── Non-sensitive → Any option14 └── Business data → Self-host recommended15 └── Regulated → Self-host required16 174. SCALE NEEDS18 └── <1000 exec/day → Any option19 └── 1000-10000 → VPS or Cloud Pro20 └── 10000+ → Dedicated VPS or K8s21 225. UPTIME REQUIREMENTS23 └── Can tolerate downtime → Any24 └── 99% uptime → Good VPS + monitoring25 └── 99.9% uptime → HA setup or K8sQuick Recommendation:
Text
1JUST STARTING:2→ Use n8n Cloud free trial3 4SIDE PROJECT:5→ Railway (free tier or $5/mo)6 7SERIOUS PRODUCTION:8→ Hetzner VPS + Docker ($8-15/mo)9 10ENTERPRISE:11→ K8s hoặc n8n Enterprise CloudCost Analysis (1 Year)
Text
1OPTION SETUP MONTHLY YEARLY HIDDEN COSTS2──────────────────────────────────────────────────────────3n8n Cloud Pro 0 $50 $600 None4Railway $0 $15 $180 Overages5Hetzner VPS $20* $8 $116 Your time6DigitalOcean $20* $12 $164 Your time7K8s (managed) $100* $50 $700 Complexity8 9*One-time setup cost (your time estimated)10 11WINNER FOR MOST: VPS self-host ($8-15/mo)12WINNER FOR LAZY: n8n Cloud ($50/mo)Getting Ready
Pre-Deployment Checklist:
Text
1□ Decide on deployment option2□ Estimate executions/month3□ List required integrations4□ Identify data requirements5□ Plan backup strategy6□ Document access credentials7□ Choose domain name8□ Set budgetYour Action
Before next lesson:
- Choose your deployment path
- Sign up for chosen platform
- Get domain ready (optional)
- Note down credentials needed
We'll start hands-on Docker in next lesson! 🐳
Tiếp Theo
Bài tiếp theo: Docker Basics - Hiểu images, containers, volumes và cách Docker hoạt động cho n8n.
