cheat-sheets

Open WebUI and Self-Hosted AI Stacks

Open WebUI is a self-hosted chat interface for Ollama and any OpenAI-compatible API. Run it with Ollama in Docker Compose for a private ChatGPT-style stack.

Project: Open WebUI Documentation: Open WebUI docs

Verification: image name, port, volume path and environment variables are from the official docs as remembered; nothing was run here. Check the docs for current variable names. Items marked (unverified) need confirming.

Compose Stack #

Replace <TAG> with a pinned version. The first account created becomes the administrator.

yaml
services:
  ollama:
    image: ollama/ollama:<TAG>
    restart: unless-stopped
    volumes:
      - ollama:/root/.ollama
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

  open-webui:
    image: ghcr.io/open-webui/open-webui:<TAG>
    restart: unless-stopped
    depends_on:
      - ollama
    ports:
      - "127.0.0.1:3000:8080"
    environment:
      OLLAMA_BASE_URL: http://ollama:11434
      WEBUI_SECRET_KEY: ${WEBUI_SECRET_KEY}
      ENABLE_SIGNUP: "false"
    volumes:
      - open-webui:/app/backend/data

volumes:
  ollama:
  open-webui:
COMMANDDESCRIPTION
openssl rand -hex 32Generate a value for WEBUI_SECRET_KEY (store in .env, not in git)
docker compose up -dStart the stack
docker compose pull && docker compose up -dUpdate
docker compose exec ollama ollama pull MODELDownload a model; it appears in the UI

Key Settings #

VARIABLEUSE
OLLAMA_BASE_URLWhere Ollama is
OPENAI_API_BASE_URL / OPENAI_API_KEYConnect an OpenAI-compatible provider or a local server
WEBUI_SECRET_KEYSession signing key; set it so logins survive restarts
ENABLE_SIGNUPAllow self-registration; turn off after creating admin (unverified)
WEBUI_AUTHDisabling auth is for single-user local use only (unverified)

Data lives in the /app/backend/data volume (users, chats, settings). Back it up: Docker Volume Backup.

Exposure #

  • Keep the port on loopback and publish through a reverse proxy with TLS.
  • For single sign-on use OIDC with authentik (unverified: check the OAuth/OIDC variables in the docs).
  • Do not expose the Ollama port itself.
PIECEPURPOSE
Ollama / llama.cppModel backends
LiteLLM proxyOne OpenAI-style gateway in front of many providers (unverified)
SearXNGSelf-hosted search for web-search features (unverified)
MCP serversTools for agents

See Also #

Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.