Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

🧠 Open WebUI – Manual Setup Without Docker

This guide walks you through deploying Open WebUI without Docker, fixing common compatibility issues, and running it cleanly on your own infrastructure.


πŸ“¦ Overview

Goal: Run Open WebUI directly using FastAPI + SvelteKit without Docker or containerization, fully self-hosted.

Environment:

  • OS: Ubuntu 22.04+ (or similar)
  • RAM: 16GB minimum (32GB+ preferred for build)
  • Disk: 2GB free for dependencies + swap
  • Internet access during setup

βœ… Requirements & Manual Installs

Install the following system dependencies:

sudo apt update
sudo apt install -y \
  git curl wget unzip \
  build-essential python3.10 python3.10-venv python3-pip \
  nodejs npm

If Node.js version is too old (check with node -v), use:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

πŸ§ͺ Python Virtual Environment Setup

cd open-webui/backend
python3.10 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

πŸ› οΈ Modifications Required to Run Successfully

1. ❌ Python 3.10 lacks StrEnum

File: open_webui/retrieval/vector/type.py

πŸ”§ Fix:

# Replace:
# from enum import StrEnum

# With:
from enum import Enum
class StrEnum(str, Enum):
    pass

2. ❌ logging.getLevelNamesMapping() is missing in 3.10

File: open_webui/env.py and possibly utils/logger.py

πŸ”§ Fix:

# Old (incompatible):
if SRC_LOG_LEVELS[source] not in logging.getLevelNamesMapping():

# Replace with a fallback check like:
valid_levels = {"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}
if SRC_LOG_LEVELS[source] not in valid_levels:
    ...

3. βœ… Make sure FastAPI entry point loads correctly

File: open_webui/main.py

Verify last line is:

app = create_app()

Then run:

python3 -m uvicorn open_webui.main:app --host 0.0.0.0 --port 3000

🧼 build.sh Script to Handle Frontend + Memory Issues

Create a file in the project root named build.sh:

chmod +x build.sh
#!/bin/bash

set -e
set -o pipefail

echo "🧼 Cleaning old builds..."
rm -rf .svelte-kit dist node_modules/.vite

echo "πŸ“¦ Setting memory limits for Node.js..."
export NODE_OPTIONS="--max-old-space-size=8192"

echo "πŸ’Ύ Ensuring swap file exists (8GB)..."
if ! grep -q '/swapfile' /etc/fstab; then
  sudo fallocate -l 8G /swapfile
  sudo chmod 600 /swapfile
  sudo mkswap /swapfile
  sudo swapon /swapfile
  echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
else
  echo "Swap file already exists."
fi

echo "πŸš€ Running npm install..."
npm install

echo "πŸ› οΈ  Building Open WebUI frontend..."
npm run build

echo "βœ… Build complete!"

πŸ” Run the App

cd backend
source venv/bin/activate
python3 -m uvicorn open_webui.main:app --host 0.0.0.0 --port 3000

Access it at: http://localhost:3000


πŸ—‚οΈ List of Manually Modified Files

File Path Modification
backend/open_webui/env.py Replaced logging.getLevelNamesMapping() with safe fallback logic
backend/open_webui/utils/logger.py Same logging compatibility fix (if used there)
backend/open_webui/retrieval/vector/type.py Added StrEnum compatibility patch for Python 3.10
build.sh (custom) Added swap creation, heap allocation, clean build script for large frontend

πŸ” Not Using Docker or Cloudflare

This deployment skips:

  • Docker
  • Docker Compose
  • Any Cloudflare Tunnels or config files

You manage access yourself using:

  • Reverse proxy (e.g., NGINX)
  • TLS certs (e.g., Let’s Encrypt)
  • Systemd service

🧠 Optional: Add to systemd

If you want to run it at boot:

# /etc/systemd/system/openwebui.service
[Unit]
Description=Open WebUI Backend Service
After=network.target

[Service]
Type=simple
User=user-name
WorkingDirectory=/home/user-name/open-webui/backend
ExecStart=/home/user-name/open-webui/backend/venv/bin/python3 -m uvicorn open_webui.main:app --host 0.0.0.0 --port 3000
Restart=on-failure
Environment=OLLAMA_API_BASE_URL=http://127.0.0.1:11434

[Install]
WantedBy=multi-user.target

Then enable:

sudo systemctl daemon-reexec
sudo systemctl enable openwebui
sudo systemctl start openwebui

βœ… Final Checklist

  • Python venv initialized
  • Dependencies installed
  • StrEnum patched
  • Logging fixed
  • Frontend built with memory limits
  • Backend launched via uvicorn

πŸ“œ License

MIT

About

A lightweight local-first web-based UI for running LLMs via Ollama. This setup runs completely outside Docker and is optimized for high-memory servers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors