The $20/Month AI Operations Stack: Self-Host Ollama + n8n + Coolify on a VPS
Cloud API costs scale linearly with usage. Self-hosting Ollama + n8n + Coolify on a $20/month VPS removes per-token fees for local Ollama inference — you still pay for the VPS, bandwidth, and your time; throughput is limited by CPU/RAM. When workflows call Apify, email, or other SaaS APIs, data transits those providers — not only your server.
This guide covers the complete setup from bare VPS to production-ready AI pipeline, with official documentation links for every step.
TL;DR:
| Component | Role | Official docs |
|---|---|---|
| Coolify | Infrastructure manager (replaces Heroku/Vercel for self-hosting) | coolify.io/docs |
| Ollama | Local LLM inference (Llama 3.1, Mistral, DeepSeek) | ollama.com |
| n8n | Workflow orchestration (visual automation) | docs.n8n.io |
| Qdrant | Vector database for AI memory/RAG (Retrieval-Augmented Generation) | qdrant.tech/documentation |
| PostgreSQL | Structured data storage | postgresql.org |
Prerequisites:
- A VPS with 4+ CPU cores, 8+ GB RAM, 80+ GB SSD ($16–$25/month range). Minimum 8 GB RAM required for running Llama 3.1 8B comfortably alongside n8n.
- A domain name pointed to the VPS IP
- Basic terminal/SSH knowledge
- 30–60 minutes of setup time









