OpenWebUI

A comprehensive guide to OpenWebUI - the intuitive web interface for interacting with local LLMs like Ollama

OpenWebUI transforms how you interact with your local language models, providing a sleek, feature-rich interface that makes working with models like Llama, Mistral, and others both powerful and intuitive.

What is OpenWebUI

OpenWebUI is an open-source, browser-based graphical user interface designed specifically for interacting with local large language models (LLMs), particularly those running through Ollama. It provides a ChatGPT-like experience for your self-hosted AI models, combining the privacy benefits of running local models with the usability of commercial AI platforms.

Originally built for Ollama, OpenWebUI has evolved into a versatile platform that supports multiple model backends while adding powerful features like document processing, multi-modal capabilities, and collaborative workspaces.

Why Do We Need OpenWebUI

While running local LLMs offers significant privacy and ownership benefits, the default command-line interface is not particularly user-friendly. This creates several challenges:

  1. Accessibility barriers: Command-line interfaces can be intimidating for non-technical users
  2. Limited context: CLI interactions don’t maintain chat history or context effectively
  3. No document handling: Basic interfaces can’t process or reference external documents
  4. Poor visualization: Text-only interfaces can’t display images or formatted results properly
  5. Limited collaboration: Command-line tools aren’t designed for team environments

OpenWebUI addresses these limitations by providing a sophisticated interface that makes local AI models more accessible and powerful while preserving their privacy advantages.

Existing LLM Interface Landscape

Before diving into OpenWebUI specifically, it’s helpful to understand the broader ecosystem of local LLM interfaces:

Command-Line Options

  • Native Ollama CLI: Basic text-based interface with limited features
  • Shell scripts: Custom automation for model interactions

Desktop Applications

  • LM Studio: Desktop application with model management and chat interface
  • GPT4All: Simple desktop chat interface for multiple model backends
  • Faraday: Native macOS application for local AI interactions

Web Interfaces

  • Jan.ai: Browser-based interface with extension capabilities
  • Anse: Simple web UI for Ollama
  • LocalAI Web UI: Basic interface for LocalAI backend
  • ChatWithDocs: Specialized for document Q&A
  • OpenWebUI: The most feature-rich web interface (our focus)

OpenWebUI’s Distinctive Features

What sets OpenWebUI apart from alternatives:

  • Multi-model support: Seamlessly switch between different models
  • Assistants & RAG: Create specialized assistants with Retrieval-Augmented Generation
  • Document processing: Upload, analyze, and chat about documents
  • Vision capabilities: Process and discuss images with compatible models
  • Collaborative workspaces: Support for multiple users and team environments
  • Custom model parameters: Fine-tune context length, temperature, and other settings
  • API integration: Connect with custom API endpoints and external tools
  • Advanced prompt templates: Create and use sophisticated prompt structures
  • Progressive web app: Install as a standalone application

Installing OpenWebUI on Ubuntu 24.04

Let’s get OpenWebUI up and running on your Ubuntu 24.04 system. This installation assumes you already have Ollama installed. If you don’t, please refer to my previous guide on installing Ollama.

Prerequisites

Make sure you have the following installed:

  • Docker and Docker Compose
  • Git
  • Ollama (running and accessible)

Installation Steps

  1. Install Docker and Docker Compose (if not already installed):

     1# Update package information
     2sudo apt update
     3
     4# Install required packages
     5sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
     6
     7# Add Docker's official GPG key
     8curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
     9
    10# Add Docker repository
    11echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    12
    13# Update repositories again
    14sudo apt update
    15
    16# Install Docker and Docker Compose
    17sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
    18
    19# Add your user to the docker group to run Docker without sudo
    20sudo usermod -aG docker $USER
    21
    22# Apply the new group membership (alternatively, you can log out and back in)
    23newgrp docker
    
  2. Clone the OpenWebUI repository:

    1# Navigate to your preferred installation directory
    2cd ~/Documents/projects
    3
    4# Clone the repository
    5git clone https://github.com/open-webui/open-webui.git
    6
    7# Navigate into the project folder
    8cd open-webui
    
  3. Configure the environment (optional):

    1# Copy the example environment file
    2cp .env.example .env
    3# Edit the configuration file if needed
    4nano .env
    

The default configuration should work with a local Ollama installation. However, you might want to customize settings like the port or authentication options.

  1. Start OpenWebUI using Docker Compose:

    1# Launch the application
    2docker compose up -d
    
  2. Access the interface:

Open your web browser and navigate to:

http://localhost:3000

You should see the OpenWebUI interface. The first time you access it, you’ll need to create an account to secure your installation.

  1. Connect to Ollama:

OpenWebUI should automatically detect your local Ollama installation. If it doesn’t:

  • Go to Settings > LLM Providers
  • Select Ollama
  • Set the endpoint to http://host.docker.internal:11434 (for Docker) or http://localhost:11434 (for direct installation)
  1. Verify with your first chat:
  • Create a new conversation
  • Select an available model from your Ollama installation
  • Send a test message to confirm everything is working

Understanding Docker Compose Configuration

When you run docker compose up -d, you’ll notice that Docker begins pulling not only OpenWebUI but also Ollama. This happens because:

  1. The default Docker Compose configuration includes Ollama as a service
  2. OpenWebUI is designed to work as a complete solution out of the box

Why Docker Pulls Ollama

The default configuration bundles both services for several reasons:

  • Simplified setup: Creates a complete, self-contained environment
  • Guaranteed compatibility: Ensures the Ollama version works with OpenWebUI
  • Optimized networking: Both services run in the same Docker network
  • Beginner-friendly: Reduces configuration complexity

Choosing Between Docker Ollama vs. Local Ollama

Option 1: Using Dockerized Ollama (Default)

Pros:

  • Completely isolated environment
  • No conflicts with system packages
  • Easy to update both components together
  • Works on any system that supports Docker

Cons:

  • Duplicates Ollama if you already have it installed
  • Models need to be downloaded again inside Docker
  • May have reduced performance compared to native installation
  • GPU passthrough requires additional configuration

Option 2: Using Your Local Ollama Installation

Pros:

  • Reuses existing models (saves disk space)
  • Potentially better performance
  • Single Ollama instance to manage
  • Can leverage existing GPU optimizations

Cons:

  • Requires modifying configuration files
  • Networking between containers and host can be tricky
  • May encounter version compatibility issues
  • More complex troubleshooting

How to Use Your Existing Ollama Installation

If you already have Ollama running locally and prefer not to duplicate it in Docker:

  1. Modify the docker-compose.yml file:
1# Make a backup first
2cp docker-compose.yml docker-compose.yml.backup
3
4# Edit the file
5nano docker-compose.yml
  1. Comment out or remove the Ollama service section and update the OpenWebUI configuration:

Here’s an example of a modified docker-compose.yml file that uses your local Ollama installation:

 1services:
 2  open-webui:
 3    build:
 4      context: .
 5      args:
 6        OLLAMA_BASE_URL: '/ollama'
 7      dockerfile: Dockerfile
 8    image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
 9    container_name: open-webui
10    volumes:
11      - open-webui:/app/backend/data
12    ports:
13      - ${OPEN_WEBUI_PORT-3000}:8080
14    environment:
15      # Point to the host machine's Ollama
16      - 'OLLAMA_BASE_URL=http://host.docker.internal:11434'
17      - 'WEBUI_SECRET_KEY='
18    extra_hosts:
19      - host.docker.internal:host-gateway
20    restart: unless-stopped
21
22volumes:
23  open-webui: {}

The key changes made:

  • Removed the entire ollama service
  • Removed the depends_on section since we no longer depend on the Ollama container
  • Changed OLLAMA_BASE_URL to point to host.docker.internal:11434 (the host machine)
  • Kept the extra_hosts setting which is essential for Linux
  • Removed the unused ollama volume
  1. Update the environment settings in the .env file:
1# Point to your local Ollama instance
2OLLAMA_API_BASE_URL=http://host.docker.internal:11434
  1. For Linux systems, ensure host mapping is configured: The extra_hosts entry in the docker-compose.yml already includes the necessary configuration.

For most users, I recommend:

  • New users: Use the default setup (with Docker Ollama) for simplicity
  • Experienced users with existing models: Configure OpenWebUI to use your local Ollama installation
  • Performance-focused setups: Use local Ollama installation with GPU acceleration

Best practice for production environments: Run both services in Docker but mount a volume for Ollama models to persist them outside the container.

1# Example docker-compose.yml snippet with volume mounting
2services:
3  ollama:
4    image: ollama/ollama:latest
5    volumes:
6      - ./ollama-data:/root/.ollama

This provides the isolation benefits of Docker while keeping your models accessible and persistent.


Troubleshooting Common Issues

  • Can’t connect to Ollama: Ensure Ollama is running with ollama serve
  • Permission issues: Check Docker permissions with docker ps to verify your user can access Docker
  • Port conflicts: Edit the .env file to change the port if 3000 is already in use
  • Network issues: If using custom Docker networks, you may need to adjust the Ollama endpoint in settings
  • “depends on undefined service” error: If you see an error like service "open-webui" depends on undefined service "ollama": invalid compose project, you need to remove the depends_on section from the open-webui service in your docker-compose.yml file:
 1# Before:
 2services:
 3  open-webui:
 4    # ...existing configuration...
 5    depends_on:
 6      - ollama  # This line causes the error
 7    # ...rest of configuration...
 8
 9# After:
10services:
11  open-webui:
12    # ...existing configuration...
13    # (depends_on section removed)
14    # ...rest of configuration...
  • Connection Error with Local Ollama: If you’re still getting connection errors after removing the Ollama service, make sure the OLLAMA_BASE_URL environment variable is correctly pointing to your host machine:
1# Incorrect - Still pointing to the Ollama container
2environment:
3  - 'OLLAMA_BASE_URL=http://ollama:11434'  # This points to the now-removed container
4
5# Correct - Points to the host machine where Ollama is running
6environment:
7  - 'OLLAMA_BASE_URL=http://host.docker.internal:11434'  # This points to your local Ollama

After updating your docker-compose.yml file, you’ll need to restart the container:

1# Stop the existing container
2docker compose down
3
4# Start it with the new configuration
5docker compose up -d

If you’re on Linux and still have connection issues, you might need to use your actual machine’s IP address instead of host.docker.internal. You can find your IP with:

1hostname -I | awk '{print $1}'

Then update your docker-compose.yml to use that IP:

1environment:
2  - 'OLLAMA_BASE_URL=http://192.168.1.100:11434' # Replace with your actual IP

Note for systems with multiple network interfaces: If hostname -I returns multiple IP addresses, you should use the one that corresponds to your main internet-connected interface. For example, if you see output like:

192.168.1.1 192.168.43.235 172.17.0.1 172.18.0.1
  • Addresses in the 172.17.x.x or 172.18.x.x range are typically Docker network interfaces
  • If one address is for a specific connection (like Ethernet to another machine) and another is for internet access, use the internet-connected interface’s IP (in this example, 192.168.43.235)

The correct selection ensures that all services can communicate properly.

After updating your docker-compose.yml file, you’ll need to restart the container:

1# Stop the existing container
2docker compose down
3
4# Start it with the new configuration
5docker compose up -d

Creating a container

 1⨯ docker compose up -d                                                                                              17:05:54
 2[+] Running 14/16
 3 ⠹ open-webui [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 1.832GB / 1.832GB Pulling                                                                                       2697.2s
 4   ✔ 254e724d7786 Pull complete                                                                                                                   544.9s
 5Compose can now delegate builds to bake for better performance.
 6 To do so, set COMPOSE_BAKE=true.
 7[+] Building 2469.8s (28/28) FINISHED                                                                                                    docker:default
 8 => [open-webui internal] load build definition from Dockerfile                                                                                    0.0s
 9 => => transferring dockerfile: 6.79kB                                                                                                             0.0s
10 => [open-webui] resolve image config for docker-image://docker.io/docker/dockerfile:1                                                             2.7s
11 => [open-webui] docker-image://docker.io/docker/dockerfile:1@sha256:9857836c9ee4268391bb5b09f9f157f3c91bb15821bb77969642813b0d00518d             10.2s
12 => => resolve docker.io/docker/dockerfile:1@sha256:9857836c9ee4268391bb5b09f9f157f3c91bb15821bb77969642813b0d00518d                               0.0s
13                                                          0.0s
14 => [open-webui base  2/13] WORKDIR /app/backend                                                                                                   0.2s
15 => [open-webui base  3/13] RUN if [ 0 -ne 0 ]; then     if [ 0 -ne 0 ]; then     addgroup --gid 0 app;     fi;     adduser --uid 0 --gid 0 --hom  0.2s
16 => [open-webui base  4/13] RUN mkdir -p /root/.cache/chroma                                                                                       0.2s
17 => [open-webui base  5/13] RUN echo -n 00000000-0000-0000-0000-000000000000 > /root/.cache/chroma/telemetry_user_id                               0.2s
18 => [open-webui base  6/13] RUN chown -R 0:0 /app /root                                                                                            0.2s
19 => [open-webui base  7/13] RUN if [ "false" = "true" ]; then     apt-get update &&     apt-get install -y --no-install-recommends git build-es  805.7s
20 => [open-webui build 2/6] WORKDIR /app                                                                                                            0.3s
21 => [open-webui build 3/6] COPY package.json package-lock.json ./                                                                                  0.0s
22 => [open-webui build 4/6] RUN npm ci                                                                                                            910.5s
23 => [open-webui base  8/13] COPY --chown=0:0 ./backend/requirements.txt ./requirements.txt                                                         0.1s
24 => [open-webui base  9/13] RUN pip3 install --no-cache-dir uv &&     if [ "false" = "true" ]; then     pip3 install torch torchvision torchau  1566.3s
25 => [open-webui build 5/6] COPY . .                                                                                                                0.8s
26 => [open-webui build 6/6] RUN npm run build                                                                                                     118.3s
27 => [open-webui base 10/13] COPY --chown=0:0 --from=build /app/build /app/build                                                                    0.7s
28 => [open-webui base 11/13] COPY --chown=0:0 --from=build /app/CHANGELOG.md /app/CHANGELOG.md                                                      0.0s
29 => [open-webui base 12/13] COPY --chown=0:0 --from=build /app/package.json /app/package.json                                                      0.0s
30 => [open-webui base 13/13] COPY --chown=0:0 ./backend .                                                                                           0.1s
31 => [open-webui] exporting to image                                                                                                                8.6s
32 => => exporting layers                                                                                                                            8.6s
33 => => writing image sha256:09ef72fbc39cd341c24cc19583a89aed3903c86b122e974c2763fcf502f56b29                                                       0.0s
34 => => naming to ghcr.io/open-webui/open-webui:main                                                                                                0.0s
35 => [open-webui] resolving provenance for metadata file                                                                                            0.0s
36[+] Running 4/4
37 ✔ open-webui                      Built                                                                                                           0.0s
38 ✔ Network open-webui_default      Created                                                                                                         0.0s
39 ✔ Volume "open-webui_open-webui"  Created                                                                                                         0.0s
40 ✔ Container open-webui            Started                                                                                                         1.0s
41⋊> ~/D/p/open-webui on main ⨯                                                                                                                   18:32:08

Accessing web interface

  1. Open localhost:3000 in your web browser to access the OpenWebUI interface.
  2. Follow the on-screen instructions to set up your environment.
  3. Enjoy exploring the features of OpenWebUI!
1my password is password and name is Abdul Sayyed with gsayyed@hotmail.com

Issues

You’re welcome, Mr. Sayyed. Below is a concise summary of what you achieved and how you did it, formatted in Markdown for your notes or documentation.


  • OpenWebUI could not connect to http://192.168.43.235:11434

  • Running OLLAMA_HOST=0.0.0.0 ollama serve gave the error:

    1Error: listen tcp 0.0.0.0:11434: bind: address already in use
    
  • curl from Docker container to host Ollama also failed:

    1curl: (7) Failed to connect...
    

Diagnosis

  • The local Ollama process was already running.
  • It was likely bound to 127.0.0.1:11434 (localhost only).
  • Docker containers cannot reach 127.0.0.1 of the host; they need it to be 0.0.0.0 (bind to all interfaces).

Solution Steps

  1. Verified the port binding:

    1sudo lsof -i :11434
    2# or
    3ss -ltnp | grep 11434
    
  2. Stopped the running Ollama process:

    1sudo killall ollama
    2# or use `ps aux | grep ollama` and `sudo kill <PID>`
    
  3. Restarted Ollama with global network binding:

    1OLLAMA_HOST=0.0.0.0 ollama serve
    
  4. Tested connectivity from inside Docker:

    1docker run --rm --network=host curlimages/curl http://192.168.43.235:11434
    
  5. Updated docker-compose.yaml for OpenWebUI:

    1environment:
    2  - 'OLLAMA_BASE_URL=http://192.168.43.235:11434'
    

Result

  • OpenWebUI (inside Docker) is now connected to the host machine’s Ollama instance.
  • No duplication of models or Docker-based Ollama is needed.
  • System is clean, performant, and avoids unnecessary downloads.

Conclusion

In this guide, we successfully configured OpenWebUI to connect to a locally running Ollama instance. By ensuring proper network bindings and updating the Docker configuration, we created a seamless integration between the web interface and the underlying model server. This setup not only enhances accessibility but also optimizes resource usage by avoiding unnecessary duplications.

Deploy on the Cloud

Want to make OpenWebUI accessible anywhere? Deploy on DigitalOcean for a reliable cloud server with free credits to get started.