Open WebUI + Ollama: Self-Hosted ChatGPT in 10 Minutes

Set up Open WebUI with Ollama for a self-hosted ChatGPT-like experience. Covers Docker Compose installation, model configuration, user management, plugins, and HTTPS reverse proxy setup.

Open WebUI gives you a polished, ChatGPT-like interface for your local LLMs. Combined with Ollama as the backend, it provides a self-hosted AI chat experience with conversation history, model switching, document upload, user management, and more. No data leaves your machine. This guide gets you from zero to a fully working setup in under 10 minutes.

Quick Start (2 Minutes)

If you just want to get running immediately:

# 1. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# 2. Pull a model
ollama pull llama3.1:8b

# 3. Run Open WebUI
docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:main

Open http://localhost:3000 in your browser. Create an account (the first user is admin). Start chatting.

That’s it. If you want to understand and customize the setup, read on.

Prerequisites

  • Docker installed and running
  • Ollama installed (or plan to run it in Docker too)
  • 8 GB RAM minimum (16 GB recommended)
  • 5 GB disk space for Open WebUI + a model

Install Docker

If Docker isn’t installed:

# Linux
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

# macOS / Windows
# Download Docker Desktop from docker.com

Install Ollama

# Linux / macOS
curl -fsSL https://ollama.com/install.sh | sh

# Windows
# Download from ollama.com/download

# Pull your first model
ollama pull llama3.1:8b

Method 1: Docker Run (Simplest)

Ollama on Host + Open WebUI in Docker

This is the most common setup: Ollama runs natively on your machine, and Open WebUI runs in Docker.

docker run -d \
  -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:main

What each flag does:

  • -d: Run in background
  • -p 3000:8080: Expose on port 3000
  • --add-host=host.docker.internal:host-gateway: Allow container to reach host’s Ollama
  • -v open-webui:/app/backend/data: Persist data (conversations, settings)
  • --restart unless-stopped: Auto-restart on boot

Both in Docker (GPU)

Run both Ollama and Open WebUI in Docker, with GPU access:

# Start Ollama container with GPU
docker run -d \
  --gpus all \
  -v ollama:/root/.ollama \
  -p 11434:11434 \
  --name ollama \
  --restart unless-stopped \
  ollama/ollama

# Start Open WebUI, connecting to Ollama container
docker run -d \
  -p 3000:8080 \
  -e OLLAMA_BASE_URL=http://ollama:11434 \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --link ollama:ollama \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:main

# Pull a model
docker exec ollama ollama pull llama3.1:8b

Docker Compose manages both services together and is easier to maintain.

Basic Compose Stack

Create a docker-compose.yml file:

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

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
    volumes:
      - webui_data:/app/backend/data
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  webui_data:
# Start everything
docker compose up -d

# Pull a model
docker exec ollama ollama pull llama3.1:8b

# Check status
docker compose ps

# View logs
docker compose logs -f open-webui

CPU-Only Compose Stack

If you don’t have an NVIDIA GPU, remove the GPU reservation:

services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    volumes:
      - ollama_data:/root/.ollama
    ports:
      - "11434:11434"
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - "3000:8080"
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
    volumes:
      - webui_data:/app/backend/data
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  webui_data:

Method 3: pip Install (No Docker)

pip install open-webui

# Start with default settings (connects to localhost:11434)
open-webui serve

# Custom port and host
open-webui serve --port 8080 --host 0.0.0.0

Initial Configuration

First Login

  1. Open http://localhost:3000 in your browser
  2. Click Sign Up
  3. Enter your name, email, and password
  4. The first user automatically becomes the admin

Pull Models

You can pull models directly from the Open WebUI interface:

  1. Click the model dropdown in the chat area
  2. Enter a model name (e.g., llama3.1:8b) in the search field
  3. Click the download icon to pull it

Or from the command line:

# Essential models
docker exec ollama ollama pull llama3.1:8b          # General chat
docker exec ollama ollama pull qwen2.5-coder:7b     # Coding
docker exec ollama ollama pull nomic-embed-text      # Embeddings (for RAG)

# Optional
docker exec ollama ollama pull llama3.1:70b          # Large model (48+ GB VRAM)
docker exec ollama ollama pull llama3.2-vision:11b   # Vision model
docker exec ollama ollama pull phi3:mini             # Small and fast

Admin Settings

Navigate to Admin Panel (gear icon or /admin):

General Settings:

  • Default model for new users
  • System prompt
  • Enable/disable features

User Management:

  • View all registered users
  • Assign roles (admin, user)
  • Enable/disable self-registration
  • Set allowed email domains

Model Access:

  • Control which models each user can access
  • Set default models per user group

Model Configuration

Custom Model Profiles

Create model profiles with specific system prompts and parameters:

  1. Go to Workspace > Models
  2. Click Create a Model
  3. Configure:
    • Name: “Code Assistant”
    • Base Model: qwen2.5-coder:7b
    • System Prompt: “You are an expert programmer…”
    • Parameters: temperature 0.1, context length 8192

Model Parameters

In any chat, click the model settings icon to adjust:

ParameterDefaultDescription
Temperature0.7Higher = more creative, lower = more focused
Top P0.9Nucleus sampling threshold
Top K40Limit vocabulary for each token
Repeat Penalty1.1Reduce repetition
Context Length2048How much conversation history to include
Max Tokens1024Maximum response length

Document Upload and RAG

Open WebUI has built-in RAG (Retrieval-Augmented Generation) for chatting with your documents.

Upload Documents in Chat

  1. Click the + button in the chat input area
  2. Select Upload Files
  3. Choose PDF, TXT, DOCX, or other supported files
  4. The file is chunked, embedded, and indexed locally
  5. Ask questions about the uploaded content

Knowledge Collections

Create persistent document collections:

  1. Go to Workspace > Knowledge
  2. Click Create Knowledge Base
  3. Upload documents to the collection
  4. In a chat, type # and select the knowledge base to include it as context

RAG Configuration

Go to Admin Panel > Settings > Documents:

  • Chunk Size: Default 1000 characters (adjust based on content type)
  • Chunk Overlap: Default 200 characters
  • Embedding Model: Set to nomic-embed-text (pull it first in Ollama)
  • Top K: Number of chunks to retrieve (default 4)
# Make sure embedding model is available
docker exec ollama ollama pull nomic-embed-text

User Management

Multi-User Setup

Open WebUI supports multiple users out of the box:

Admin controls:

  • Enable/disable new user registration
  • Require email verification
  • Set allowed email domains (e.g., @yourcompany.com)
  • Assign user roles (admin, user, pending)
  • View and manage user sessions

Per-user features:

  • Private conversation history
  • Personal settings and preferences
  • Custom model profiles
  • Uploaded documents (private by default)

Disable Self-Registration

For team deployments, you may want to control who can sign up:

# In docker-compose.yml
environment:
  - ENABLE_SIGNUP=false  # Disable self-registration
  - WEBUI_AUTH=true       # Require authentication

Then create users manually via the Admin Panel.

SSO / OIDC Integration

For enterprise deployments with single sign-on:

environment:
  - ENABLE_OAUTH_SIGNUP=true
  - OAUTH_MERGE_ACCOUNTS_BY_EMAIL=true
  - OAUTH_CLIENT_ID=your-client-id
  - OAUTH_CLIENT_SECRET=your-client-secret
  - OPENID_PROVIDER_URL=https://accounts.google.com/.well-known/openid-configuration
  # Or Azure AD, Okta, Keycloak, etc.

Plugins and Functions

Open WebUI supports custom functions (tools and filters) that extend the AI’s capabilities.

Built-in Tools

Open WebUI includes several built-in tools:

  • Web Search: Search the internet from within chat
  • Image Generation: Generate images (requires compatible backend)
  • Code Execution: Run Python code in sandboxed environment

Installing Community Functions

  1. Go to Workspace > Functions
  2. Click Import or browse the community library
  3. Enable the function in your chat settings

Example: Web Search Tool

# Enable web search in docker-compose.yml
environment:
  - RAG_WEB_SEARCH_ENABLED=true
  - RAG_WEB_SEARCH_ENGINE=searxng
  - SEARXNG_QUERY_URL=http://searxng:8080/search?q=<query>

Add SearXNG to your Docker Compose stack:

services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - "8080:8080"
    volumes:
      - searxng_data:/etc/searxng
    restart: unless-stopped

volumes:
  searxng_data:

HTTPS Reverse Proxy

For production or team use, serve Open WebUI over HTTPS.

Option A: Caddy (Simplest)

Caddy automatically handles SSL certificates:

# Add to docker-compose.yml
  caddy:
    image: caddy:alpine
    container_name: caddy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
    depends_on:
      - open-webui
    restart: unless-stopped

volumes:
  caddy_data:
# Caddyfile
ai.yourdomain.com {
    reverse_proxy open-webui:8080
}

Option B: Nginx with Let’s Encrypt

  nginx:
    image: nginx:alpine
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - /etc/letsencrypt:/etc/letsencrypt:ro
    depends_on:
      - open-webui
    restart: unless-stopped
# nginx.conf
server {
    listen 80;
    server_name ai.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name ai.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/ai.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ai.yourdomain.com/privkey.pem;

    client_max_body_size 50M;

    location / {
        proxy_pass http://open-webui:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 300s;
    }
}

Generate certificates:

sudo apt install certbot
sudo certbot certonly --standalone -d ai.yourdomain.com

Updating Open WebUI

# Docker Compose
docker compose pull open-webui
docker compose up -d open-webui

# Docker Run
docker pull ghcr.io/open-webui/open-webui:main
docker stop open-webui
docker rm open-webui
docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:main

Your data persists in the Docker volume, so updates don’t lose conversations or settings.

Backup and Restore

Backup

# Backup Open WebUI data
docker run --rm \
  -v open-webui:/source:ro \
  -v $(pwd)/backups:/backup \
  alpine tar czf /backup/open-webui-$(date +%Y%m%d).tar.gz -C /source .

# Backup Ollama models
docker run --rm \
  -v ollama_data:/source:ro \
  -v $(pwd)/backups:/backup \
  alpine tar czf /backup/ollama-$(date +%Y%m%d).tar.gz -C /source .

Restore

# Restore Open WebUI data
docker run --rm \
  -v open-webui:/target \
  -v $(pwd)/backups:/backup \
  alpine tar xzf /backup/open-webui-20260408.tar.gz -C /target

Export Conversations

Individual users can export their conversations:

  1. Go to Settings > General
  2. Click Export All Chats
  3. Download as JSON

Troubleshooting

Open WebUI Can’t Connect to Ollama

# Check if Ollama is running
curl http://localhost:11434/api/tags

# If using Docker-to-host connection
# Make sure --add-host=host.docker.internal:host-gateway is set

# If using Docker-to-Docker
# Make sure OLLAMA_BASE_URL=http://ollama:11434 is set
# and both containers are on the same Docker network

# Check Open WebUI logs
docker logs open-webui 2>&1 | tail -20

Models Not Showing Up

# Check if models are pulled
docker exec ollama ollama list

# If empty, pull a model
docker exec ollama ollama pull llama3.1:8b

# Refresh models in Open WebUI
# Click the refresh icon next to the model dropdown

Slow Performance

# Check if GPU is being used
docker exec ollama nvidia-smi  # Should show GPU info

# If Ollama is running on CPU, verify GPU passthrough
docker run --rm --gpus all nvidia/cuda:12.6.0-base-ubuntu24.04 nvidia-smi

Reset Admin Password

# Access the Open WebUI container
docker exec -it open-webui bash

# Use the built-in admin reset (check current docs for exact command)
# Or delete the data volume and re-register:
docker compose down
docker volume rm open-webui  # WARNING: deletes all data
docker compose up -d

Feature Highlights

Here’s a summary of what Open WebUI offers beyond basic chat:

FeatureDescription
Multi-model chatSwitch between models mid-conversation
Model comparisonChat with two models side-by-side
Conversation branchingFork conversations to explore different paths
Document RAGUpload and chat with documents
Knowledge basesPersistent document collections
Web searchSearch the internet from chat
Image generationGenerate images with compatible backends
Voice inputSpeak instead of typing
Code highlightingSyntax-highlighted code with copy button
Markdown renderingFull markdown support in responses
Export/importExport conversations as JSON
API accessOpenAI-compatible API for external tools
Mobile responsiveWorks on phones and tablets
Dark/light themeSystem-aware theme switching
Keyboard shortcutsPower user efficiency
Custom promptsSaved prompt templates

Next Steps

Frequently Asked Questions

Is Open WebUI free?

Yes. Open WebUI is 100% free and open source under the MIT license. There are no usage limits, no premium tiers, and no telemetry. You host it yourself, so the only costs are your hardware and electricity.

Can multiple users share the same Open WebUI instance?

Yes. Open WebUI has built-in user management with authentication. The first user who signs up becomes the admin. Subsequent users can self-register (if enabled) or be invited by the admin. Each user has their own conversation history, settings, and model access. Admin can control which models are available to which users.

Does Open WebUI work without Docker?

Yes. You can install Open WebUI directly with pip: 'pip install open-webui && open-webui serve'. However, Docker is recommended because it handles dependencies, provides isolation, makes updates easy (just pull the new image), and simplifies configuration.