> [ POCKET_NODE ]: Stop renting mobile AI. Local LLM on Android. Lite is free. Pro is $19.99 once. Zero cloud. Zero subscription. [ GET POCKET NODE FREE ]

n8n + Ollama: Building a Self-Hosted AI Automation Stack

n8n is the automation glue that makes a homelab actually useful. When you pair it with Ollama running local LLMs, you get a self-hosted AI automation stack that rivals anything in the cloud — without a single API bill or data leaving your network.

What This Stack Does

My current setup runs a dozen automations including:

  • Daily AI news digest — RSS ingestion, Ollama summarization, auto-published to Ghost CMS
  • Email triage — classifies and routes incoming mail using local LLM
  • Home Assistant triggers — voice commands processed by local LLM, no cloud
  • Content calendar — Ollama drafts outlines, n8n schedules and queues them

The Architecture

# n8n talks to Ollama directly via HTTP
# No API keys. No rate limits. No cost.

POST http://your-ollama-host:11434/api/generate
{
  "model": "llama3.1:8b",
  "prompt": "Summarize this article in 3 bullets: ...",
  "stream": false,
  "keep_alive": 0
}

The keep_alive: 0 flag unloads the model from VRAM immediately after each call — critical if you're running multiple models on the same GPU without enough headroom.

n8n Docker Setup

services:
  n8n:
    image: n8nio/n8n:latest
    environment:
      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_FUNCTION_ALLOW_EXTERNAL=*
      - N8N_SECURE_COOKIE=false
    ports:
      - "5678:5678"
    volumes:
      - n8n_data:/home/node/.n8n

Key Gotchas

  • Docker networking: from inside n8n container, reach other containers by name (ghost:2368), not by host IP — that times out
  • n8n 2.x Code nodes: is not available — use require('http') directly for HTTP calls
  • Model names matter: llama3.2 doesn't exist — always verify with ollama list first

The full workflow file is available in my Templates section for Starter members.

> [ END_OF_TRANSMISSION ]

Get the Zero Cloud Tax Brief

One email with cost-saving case studies, hardware buying advice, and local-first automation notes for operators replacing monthly AI SaaS spend.

[ GET THE BRIEF ]