Ollama With Open WebUI

Give Ollama a ChatGPT-style browser interface with Open WebUI, running locally in Docker.

TL;DR

  1. Run Open WebUI with docker run for a chat UI.
  2. It auto-detects Ollama at localhost:11434 on the same host.
  3. Open the UI in a browser at localhost:3000.

Install With Docker

    docker run

    Start Open WebUI in a container.

    docker run -d -p 3000:8080 \
      --name open-webui \
      ghcr.io/open-webui/open-webui:main
    Persist Data

    Mount a volume for chats and accounts.

    -v open-webui:/app/backend/data

Connect To Ollama

    Same Host

    It auto-detects a local Ollama instance.

    # Auto-connects to localhost:11434
    host.docker.internal

    Reach host Ollama from inside Docker.

    -e OLLAMA_BASE_URL=\
      http://host.docker.internal:11434
    Pick A Model

    Choose a pulled model in the UI dropdown.

    # Select a model top-left, then chat

Key Features

    Multi-Model Chat

    Switch between pulled models per conversation.

    # Dropdown lists all local models
    Chat History

    Conversations are saved for later.

    # Stored in the mounted data volume
    Document Upload

    Upload files for retrieval-augmented chat.

    # Attach docs for RAG in the chat box
    Image Input

    Send images to vision models.

    # Works with llava and other vision models

pip Alternative

    Install

    Install Open WebUI as a Python package.

    pip install open-webui
    Serve

    Run the server on port 8080.

    open-webui serve

Tips

  1. Mount a volume at /app/backend/data so your chats, accounts, and settings survive Open WebUI container restarts.
  2. If Ollama runs on the host and the UI in Docker, set OLLAMA_BASE_URL to http://host.docker.internal:11434.

Warnings

  1. The first account you create in Open WebUI becomes the admin; create it right away, on a trusted network only.
  2. A container cannot reach host localhost; use host.docker.internal or the host IP so the UI finds Ollama.

In Practice

FAQ