Skip to main content
Back to Category

Open WebUI Setup: ChatGPT-Like Interface for Local AI

Open WebUI installation with Docker, Ollama integration, user management, RAG (document querying), model management, custom prompts and multi-user support.

Read time: 14 min AI & ML Self-Hosting
open-webuichatgptartificial intelligenceollamaself-hostingdockerrag
Author
REXE Teknoloji Network & Security Team
Editor
REXE Teknoloji Technical Editorial
First published
Last updated

Open WebUI Setup: ChatGPT-Like Interface for Local AI

Open WebUI (formerly Ollama WebUI) is an open-source project that provides a modern ChatGPT-like web interface for your local LLM models. Integrated with Ollama, you can chat with your AI models through the browser, upload documents and query your documents with RAG (Retrieval-Augmented Generation).

What is Open WebUI?

Open WebUI is a comprehensive web interface designed for self-hosted AI experience. Key features:

  • ChatGPT-Like Interface: Modern, user-friendly chat experience
  • Ollama Integration: Direct connection with local LLM models
  • RAG Pipeline: Document upload and document-based querying
  • Multi-User: User management and role-based access
  • Model Management: Download, delete and configure models from the interface
  • Custom Prompts: System prompt templates and sharing
  • Chat History: Record and search all conversations
  • Markdown Support: Code blocks, tables and rich text formatting

System Requirements

ComponentMinimumRecommended
RAM4 GB (for UI)8 GB+
Disk5 GB10 GB+
Docker20.10+Latest
OllamaInstalled and runningSame server or network

Docker Installation

Ollama on Same Server

If Ollama is running on the same server:

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

Bundled with Ollama (Single Container)

To run Ollama and Open WebUI in a single container:

hljs bash
docker run -d \
  --name open-webui \
  -p 3000:8080 \
  --gpus all \
  -v ollama:/root/.ollama \
  -v open-webui:/app/backend/data \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:ollama
hljs yaml
version: '3.8'
services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    ports:
      - "11434:11434"
    volumes:
      - ollama_data:/root/.ollama
    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
      - WEBUI_SECRET_KEY=your-strong-secret-key-here
      - ENABLE_SIGNUP=true
      - DEFAULT_USER_ROLE=pending
    volumes:
      - open-webui_data:/app/backend/data
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:

Start:

hljs bash
docker compose up -d

Initial Configuration

Navigate to http://SERVER_IP:3000 in your browser.

Creating Admin Account

The first user to register automatically becomes admin:

  1. Click Sign Up
  2. Enter name, email and password
  3. First user gets admin role

Create the first user immediately. Otherwise someone else could become admin. After registration, set ENABLE_SIGNUP=false to disable new registrations.

Ollama Connection

Verify Ollama connection from admin panel:

  1. Admin PanelSettingsConnections
  2. Ollama URL: http://ollama:11434 (Docker Compose) or http://host.docker.internal:11434
  3. Click Test Connection to verify

Model Management

Download Models from Interface

  1. Admin PanelSettingsModels
  2. Enter model name (e.g., llama3.1)
  3. Click Pull
  4. Track download progress

Download Models via CLI

hljs bash
docker exec -it ollama ollama pull llama3.1
docker exec -it ollama ollama pull mistral
docker exec -it ollama ollama pull codellama

RAG (Retrieval-Augmented Generation)

Open WebUI supports document upload and document-based querying:

Uploading Documents

  1. Click + in the chat window
  2. Upload PDF, TXT, DOCX, MD files
  3. Document is automatically chunked and embeddings are created
  4. Ask questions referencing the document in chat

RAG Configuration

Admin PanelSettingsDocuments:

Chunk Size: 1000
Chunk Overlap: 200
Embedding Model: nomic-embed-text
Top K: 5

Embedding Model Setup

hljs bash
docker exec -it ollama ollama pull nomic-embed-text

User Management

Roles

  • Admin: Full access (settings, users, models)
  • User: Chat and document upload
  • Pending: User awaiting approval

User Settings

hljs bash
# Environment variables
ENABLE_SIGNUP=true
DEFAULT_USER_ROLE=pending
ENABLE_LOGIN_FORM=true

Custom System Prompts

Define custom system prompts for each model:

  1. WorkspaceModels → Select model
  2. Write in System Prompt field:
You are a REXE Technology technical support assistant.
You specialize in server management, Docker, Linux and networking.
Include code examples.
Explain step by step.

Prompt Templates

WorkspacePromptsCreate Prompt:

Title: Linux Troubleshooting
Command: /linux-fix
Content: "Analyze the following Linux issue and suggest a solution:
1. List possible causes
2. Provide diagnostic commands
3. Write step-by-step solution
4. Add prevention tips

Issue: {{prompt}}"

Nginx Reverse Proxy

hljs nginx
server {
    listen 80;
    server_name ai.example.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name ai.example.com;

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

    location / {
        proxy_pass http://localhost:3000;
        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";
    }

    client_max_body_size 100M;
}

Updating

hljs bash
docker compose pull
docker compose up -d

Troubleshooting

hljs bash
# Open WebUI logs
docker logs open-webui

# Ollama connection test
docker exec open-webui curl -s http://ollama:11434/api/tags

# Container status
docker ps | grep -E 'open-webui|ollama'

With REXE VPS servers, you can set up your own ChatGPT alternative using Open WebUI. Your data stays completely under your control.

Frequently Asked Questions

Which AI models does Open WebUI support?

Open WebUI supports all models running through Ollama: Llama 3.1, Mistral, Gemma 2, Phi-3, CodeLlama and more. It can also connect to OpenAI API compatible services.

How does RAG work in Open WebUI?

RAG (Retrieval-Augmented Generation) splits your uploaded documents into chunks and creates embedding vectors. When you ask a question, relevant document chunks are found and provided as context to the model. This way the model produces accurate answers based on your documents.

Can multiple users use it simultaneously?

Yes, Open WebUI supports multiple users. Each user has their own chat history, settings and documents. Admin can manage user roles and access permissions.

Where is my Open WebUI data stored?

All data (chat history, user info, uploaded documents) is stored in the Docker volume at /app/backend/data. Data persistence is ensured through volume mounts. Copy this volume for backups.

Can I use Open WebUI with OpenAI API?

Yes, Open WebUI works with both Ollama and OpenAI API. You can add your OpenAI API key in Settings → Connections to use models like GPT-4 and GPT-3.5.

Will my data be deleted during Open WebUI updates?

No, your data remains safe as long as you use Docker volumes. During updates, the container is recreated but volume data is preserved. It's still recommended to backup before updating.

Related Articles

Ollama Installation: Local LLM Running Guide

Ollama installation, running local LLM models (Llama 3, Mistral, Gemma), API usage, model management, GPU acceleration and Docker deployment.

15 min
ollamallmartificial intelligence

Stable Diffusion Setup: Self-Hosted Image Generation

Stable Diffusion installation, AUTOMATIC1111 and ComfyUI interfaces, model downloading, LoRA training, ControlNet usage and Docker self-hosted image generation guide.

16 min
stable-diffusionimage generationartificial intelligence
Network TrafficInbound GbpsOutbound Gbps