Aulafy
Courses/Self-hosted AI automation for small businesses/Docker Compose for a Complete Local AI Stack

Docker Compose for a Complete Local AI Stack

A useful local stack shouldn't be a folder full of loose commands. Docker Compose lets you spin up the interface, automation, and vector database with volumes, profiles, and a clear backup path.

  • Separate base services from optional services using profiles.
  • Persist state in durable volumes.
  • Avoid the classic "it works in my terminal, but I don't know how to repeat it" problem.
TerminalCode
services:
  qdrant:
    image: qdrant/qdrant:latest
    ports: ["6333:6333"]
    volumes:
      - qdrant_data:/qdrant/storage

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    ports: ["3000:8080"]
    volumes:
      - open_webui_data:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://host.docker.internal:11434

  n8n:
    image: n8nio/n8n:latest
    profiles: ["automation"]
    ports: ["5678:5678"]
    volumes:
      - n8n_data:/home/node/.n8n
    environment:
      - N8N_ENCRYPTION_KEY=change-me

volumes:
  qdrant_data:
  open_webui_data:
  n8n_data:
TerminalCode
# Base: Qdrant + Open WebUI
docker compose up -d

# Añadir automatización con n8n
docker compose --profile automation up -d

# Ver estado y logs
docker compose ps
docker compose logs -f open-webui

# Backup mínimo
docker run --rm -v open_webui_data:/data -v "$PWD:/backup" alpine   tar czf /backup/open-webui-backup.tgz /data

Official sources

  • Docker Compose
  • Docker Compose profiles
  • Open WebUI documentation
  • Qdrant documentation
  • n8n Docs