Sign inSign up

kylefoxaustin/openwebui

By kylefoxaustin

•Updated over 1 year ago

OBSOLETE. GO TO kylefoxaustin/openwebui-ollama instead.

0

49

kylefoxaustin/openwebui repository overview

⁠OpenWebUI with Ollama Docker Images

Docker images combining OpenWebUI⁠ with Ollama⁠ for a seamless AI development experience.

⁠Available Images

  • kylefoxaustin/openwebui-ollama:latest or kylefoxaustin/openwebui-ollama:latest-cpu - CPU version
  • kylefoxaustin/openwebui-ollama:latest-gpu - GPU version with NVIDIA CUDA support

⁠Quick Start

⁠CPU Version
docker run -d \
  --name openwebui \
  -p 8080:8080 \
  -p 11434:11434 \
  -v ollama-data:/root/.ollama \
  -v openwebui-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest
⁠GPU Version
docker run -d \
  --name openwebui-gpu \
  --gpus all \
  -p 8080:8080 \
  -p 11434:11434 \
  -v ollama-data:/root/.ollama \
  -v openwebui-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest-gpu

Access the web interface at: http://localhost:8080⁠

⁠Usage Scenarios

⁠Coexisting with Local Ollama Installation

If you already have Ollama running on your host machine, you'll need to map the container's Ollama port to a different host port:

docker run -d \
  --name openwebui \
  -p 8080:8080 \
  -p 11435:11434 \
  -v ollama-data:/root/.ollama \
  -v openwebui-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest
⁠Running CPU and GPU Containers Simultaneously

To run both CPU and GPU containers at the same time, use different port mappings:

# CPU Container
docker run -d \
  --name openwebui-cpu \
  -p 8080:8080 \
  -p 11434:11434 \
  -v ollama-cpu-data:/root/.ollama \
  -v openwebui-cpu-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest-cpu

# GPU Container
docker run -d \
  --name openwebui-gpu \
  --gpus all \
  -p 8081:8080 \
  -p 11435:11434 \
  -v ollama-gpu-data:/root/.ollama \
  -v openwebui-gpu-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest-gpu

Access the interfaces at:

⁠Using with External Ollama

To use OpenWebUI with an external Ollama instance (e.g., running on another server or container):

docker run -d \
  --name openwebui-only \
  -p 8080:8080 \
  -e OLLAMA_BASE_URL=http://<ollama-host>:11434 \
  -v openwebui-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest

Replace <ollama-host> with the hostname or IP address of your Ollama server.

⁠Environment Variables

VariableDescriptionDefault
OLLAMA_HOSTHost for Ollama to listen on0.0.0.0
PORTPort for OpenWebUI to listen on8080
HOSTHost for OpenWebUI to listen on0.0.0.0
OLLAMA_BASE_URLURL for OpenWebUI to connect to Ollamahttp://localhost:11434

⁠Data Persistence

The following volumes are used for data persistence:

  • /root/.ollama: Ollama models and configuration
  • /app/backend/data: OpenWebUI data (conversations, settings, etc.)

⁠Troubleshooting

⁠Common Issues
  1. Port Conflicts: If you see "address already in use" errors, you likely have another service using the same port. Use alternative ports as shown in the usage scenarios.

  2. GPU not detected: Ensure your NVIDIA drivers are properly installed and the NVIDIA Container Toolkit is set up correctly. Test with:

    docker run --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi
    
  3. Container crashes: Check logs with:

    docker logs openwebui
    
  4. Models not loading: The first time you pull a model might take some time. Check the Ollama logs:

    docker exec -it openwebui cat /var/log/supervisor/ollama.err.log
    
  5. Web UI not accessible: Make sure that the internal Ollama instance is properly running:

    docker exec -it openwebui curl -s http://localhost:11434/api/tags
    

⁠Advanced Configuration

⁠Docker Compose

For more complex setups, you can use Docker Compose. Here's an example configuration:

version: '3.8'

services:
  openwebui:
    image: kylefoxaustin/openwebui-ollama:latest-gpu
    container_name: openwebui
    restart: unless-stopped
    ports:
      - "8080:8080"
      - "11434:11434"
    volumes:
      - ollama-data:/root/.ollama
      - openwebui-data:/app/backend/data
    environment:
      - OLLAMA_HOST=0.0.0.0
      - PORT=8080
      - HOST=0.0.0.0
      - OLLAMA_BASE_URL=http://localhost:11434
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

volumes:
  ollama-data:
  openwebui-data:

Save this to docker-compose.yml and run with:

docker-compose up -d
⁠Resource Limits

To control CPU and memory usage:

docker run -d \
  --name openwebui \
  --cpus 4 \
  --memory 8G \
  -p 8080:8080 \
  -p 11434:11434 \
  -v ollama-data:/root/.ollama \
  -v openwebui-data:/app/backend/data \
  kylefoxaustin/openwebui-ollama:latest

⁠Building from Source

If you want to build the images yourself:

# CPU image
docker build -f Dockerfile.cpu -t openwebui-ollama:cpu .

# GPU image
docker build -f Dockerfile.gpu -t openwebui-ollama:gpu .

⁠License

These Docker images combine OpenWebUI and Ollama, each with their respective licenses. See the original projects for more information.

kylefoxaustin

Tag Summary

No tags have been pushed to this repository yet.