Skip to content
1 min read 128 words

Run Llama Locally in n8n with Ollama (No API Bills)

Connect n8n to Ollama for local Llama models: Docker network DNS, OLLAMA_HOST, and a compose stack for private AI automation.

WorkFlowAI editorial · Trust

#n8n #ollama #llama #local-llm

Pair n8n with Ollama to run Llama-class models without per-token API bills. The key is correct Docker DNS—not localhost between containers.

Docker Compose stack running n8n and Ollama together

Shared Compose networks let n8n call http://ollama:11434 by service name.

Compose network pattern

Put both services on one bridge network. Set n8n’s Ollama base URL to http://ollama:11434 (service name), then pull a model with docker exec + ollama run.

Local AI automation pipeline without cloud token costs

Keep heavy models on a GPU host; point n8n at Ollama over the private network.

Workflow tips

  • Use HTTP Request nodes against Ollama’s API.
  • Cap context size to protect RAM.
  • For host-installed Ollama, see ECONNREFUSED fixes.

About the publisher

WorkFlowAI is an open catalog of AI automation workflows, MCP servers, and tools. Guides are written to help operators install and evaluate recipes — with honest Verified vs Community labels.

Related reading

Use this in the library

← All posts