Info::IA:script d'installation de open-webui

De wiki_pcwiki2
Aller à la navigationAller à la recherche

KEYWORDS: IA, OPEN-WEBUI, OLLAMA

Le 28/10/2025:
Script bash d'installation de open-webui (sans docker)

#!/bin/bash
# mar. 28 oct. 2025 15:07:53 CET
fnInstallOpenWebui()
{
mkdir /root/tmp.pip 2>/dev/null
export TMPDIR=/root/tmp.pip

mkdir /root/IA 2>/dev/null
cd ~/IA
rm -rf open-webui
apt update && sudo apt upgrade -y

# Installer Python 3.11+ (Debian 12 devrait l'avoir par défaut)
apt install python3 python3-pip python3-venv git -y

# Installer Node.js (version 18+)
apt install nodejs -y

git clone https://github.com/open-webui/open-webui.git
chown -R $USER:$USER open-webui
cd open-webui/
python3 -m venv venv
source venv/bin/activate

# Installer les dépendances
pip install --upgrade pip
pip install -r backend/requirements.txt

npm install --legacy-peer-deps
npm install y-protocols --legacy-peer-deps
npm run build

# Générer une clé secrète
python3 -c "import secrets; print(secrets.token_hex(32))" > keyGenerated.txt
echo "\
# La clé générée ici est dans keyGenerated.txt\
WEBUI_SECRET_KEY=votre_cle_generee_ici
OLLAMA_BASE_URL=http://localhost:11434" >> .env
vi .env
ollama --version

pwd
ls
export PYTHONPATH=/root/IA/open-webui/backend:$PYTHONPATH
python backend/open_webui/main.py --host 0.0.0.0 --port 8080
}

# MAIN
fnInstallOpenWebui