This guide walks you through deploying Open WebUI without Docker, fixing common compatibility issues, and running it cleanly on your own infrastructure.
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
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 npmIf 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 nodejscd open-webui/backend
python3.10 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtFile: open_webui/retrieval/vector/type.py
π§ Fix:
# Replace:
# from enum import StrEnum
# With:
from enum import Enum
class StrEnum(str, Enum):
passFile: 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:
...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 3000Create 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!"cd backend
source venv/bin/activate
python3 -m uvicorn open_webui.main:app --host 0.0.0.0 --port 3000Access it at: http://localhost:3000
| 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 |
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
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.targetThen enable:
sudo systemctl daemon-reexec
sudo systemctl enable openwebui
sudo systemctl start openwebui- Python venv initialized
- Dependencies installed
-
StrEnumpatched - Logging fixed
- Frontend built with memory limits
- Backend launched via
uvicorn
MIT