Skip to main content

Step-by-Step Installation of Open WebUI with Ollama and Docker Compose

Independent Editorial Notice: Meta Muse (metamuse.in) is an independent publication and research laboratory. We are not owned by, operated by, affiliated with, or endorsed by Meta Platforms, Inc. All technologies evaluated here are analyzed strictly for educational, engineering, and architectural research purposes.

Step-by-Step Installation of Open WebUI with Ollama and Docker Compose

Publication Metadata: Meta Muse Installation Guide | Category: Installation Guides / Container Deployment | Status: Production Draft | Difficulty: Intermediate

Overview & Why Open WebUI

Running local language models in a raw terminal is fine for debugging, but knowledge workers expect the rich features of modern chat applications: threaded conversations, document attachment (RAG), web search grounding, voice synthesis, multi-user accounts, and role-based permissions.

Open WebUI (formerly Ollama WebUI) is the premier open-source AI user interface. Built with SvelteKit and FastAPI, it integrates seamlessly with Ollama and OpenAI-compatible endpoints to deliver a self-hosted ChatGPT clone.

graph TD
    UserBrowser[Web Browser: http://localhost:3000] --> OpenWebUI[Open WebUI SvelteKit Frontend & FastAPI]
    OpenWebUI --> InternalRAG[Internal ChromaDB Vector Store RAG]
    OpenWebUI --> Ollama[Ollama Backend: http://ollama:11434]
    Ollama --> GPU[NVIDIA GPU Tensor Acceleration]

Prerequisites

  • Docker Engine 24.x+ and Docker Compose v2.x installed.
  • NVIDIA Container Toolkit installed (if GPU acceleration is used on Linux).
  • Ports 3000 and 11434 available on the host machine.

Step 1: Writing the Production docker-compose.yml

This unified Compose configuration runs both Ollama (with full NVIDIA GPU pass-through) and Open WebUI in an isolated container network.

Create a folder:

mkdir -p /opt/open-webui-stack && cd /opt/open-webui-stack

Create docker-compose.yml:

version: '3.8'

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama_backend
    restart: unless-stopped
    volumes:
      - ollama_storage:/root/.ollama
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    ports:
      - "11434:11434"

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open_webui_frontend
    restart: unless-stopped
    volumes:
      - open_webui_data:/app/backend/data
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
      - WEBUI_SECRET_KEY=generate_a_secure_random_hex_key_here
      - ENABLE_SIGNUP=true
      - DEFAULT_USER_ROLE=user
    depends_on:
      - ollama

volumes:
  ollama_storage:
  open-webui_data:

Step 2: Deploying the Stack

Launch the containers in detached mode:

docker compose up -d

Verify service execution:

docker compose ps
Expected Output:
NAME                  COMMAND            SERVICE       STATUS       PORTS
ollama_backend        "/bin/ollama se…"  ollama        running      0.0.0.0:11434->11434/tcp
open_webui_frontend   "bash start.sh"    open-webui    running      0.0.0.0:3000->8080/tcp

Step 3: Initial Setup & Admin Provisioning

  1. Open your browser and navigate to http://localhost:3000.
  2. First User Registration: The first account created automatically receives the Administrator (Root) role. Enter your name, email, and a strong password.
  3. Once logged in, navigate to Admin Panel → Settings → Connections.
  4. Confirm that the Ollama connection points to http://ollama:11434 and displays a green verified badge.

Step 4: Downloading Models Inside the Web Interface

You can pull models directly through the Open WebUI interface without touching the terminal:

  1. Navigate to Admin Panel → Settings → Models.
  2. In the Pull a model from Ollama.com field, type llama3.3 or deepseek-r1:14b.
  3. Click the Download button. The progress bar displays download speed and layer verification in real time.

Step 5: Configuring Document RAG & Web Search

Open WebUI includes native Retrieval-Augmented Generation:

  • Documents: Click the attachment (+) icon in chat to upload PDFs, TXT, or CSV files. Open WebUI extracts text, calculates embeddings using internal ChromaDB, and performs vector grounding automatically.
  • Web Search: In Admin Settings → Web Search, enable SearXNG, Tavily, or DuckDuckGo to allow the model to browse the live internet before answering.

Troubleshooting Common Errors

IssueCauseFix
502 Bad Gateway on Port 3000Open WebUI backend is still initializing database migrations.Wait 30 seconds; inspect logs via docker logs -f open_webui_frontend.
Cannot connect to OllamaNetwork name resolution failure inside Docker bridge.Ensure OLLAMA_BASE_URL=http://ollama:11434 is set in the compose file, NOT localhost.
Signup disabledAdmin disabled new user registrations.Log in with the original admin account and toggle Enable New Signups in Settings.
Upload size exceededWeb server proxy limits max body size on PDF uploads.Set WEBUI_MAX_FILE_SIZE=50 (in MB) in docker-compose.yml environment variables.

Frequently Asked Questions (RankMath Verified FAQ)

  1. Can I connect multiple remote Ollama servers to a single Open WebUI?

    Yes. Under **Admin Panel** → **Settings** → **Connections**, you can add multiple Ollama server URLs (e.g., `http://gpu-rig-1:11434` and `http://gpu-rig-2:11434`). Open WebUI aggregates all available models from both servers into a unified model picker.

  2. Does Open WebUI support OpenAI API endpoints alongside local Ollama?

    Yes. You can add your OpenAI, Anthropic, or OpenRouter API keys under Connections. Users can seamlessly switch between free local models and frontier cloud models in the same conversation thread.

    —

    ## Step 6: Backup, Restore, and Database Maintenance

    Open WebUI persists all user accounts, chat histories, system prompts, and uploaded RAG document vectors inside the `open_webui_data` Docker volume.

  3. How do I get started with this implementation?

    Clone the example repository, install the verified dependencies listed in the technical specifications table, configure environment variables, and run the automated test suite.

  4. What are the most common production failure modes?

    Common pitfalls include unhandled API rate limits, context window overflow from oversized retrieved chunks, and missing human confirmation gates on critical operations.

Related Internal Meta Muse Resources

META MUSE EDITORIAL DISCLOSURE:

This technical analysis was researched and tested independently by the Meta Muse engineering team. Meta Muse (metamuse.in) is not affiliated with Meta Platforms, Inc. or any vendor reviewed. All code examples and terminal instructions are verified on clean environments before publication.