Open WebUI - A Browser Interface for Ollama Local LLMs

Install and configure Open WebUI on Ubuntu 24.04 — a ChatGPT-like browser interface for Ollama with document upload, multi-model support, and RAG.

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.

Key Features

  • 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

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 on Ubuntu. For background on how OpenWebUI compares with LM Studio, LocalAI and Text Generation WebUI, see the local LLM ecosystem overview. If your CPU is older and lacks AVX2 support, the non-AVX Text Generation WebUI guide is a better starting point.

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)

ProsCons
Completely isolated environmentDuplicates Ollama if already installed
No conflicts with system packagesModels need to be downloaded again inside Docker
Easy to update both components togetherMay have reduced performance vs native installation
Works on any system that supports DockerGPU passthrough requires additional configuration

Option 2: Using Your Local Ollama Installation

ProsCons
Reuses existing models (saves disk space)Requires modifying configuration files
Potentially better performanceNetworking between containers and host can be tricky
Single Ollama instance to manageMay encounter version compatibility issues
Can leverage existing GPU optimizationsMore 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

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!

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.