Files
ProxmoxVE/install/openwebui-install.sh

79 lines
1.7 KiB
Bash
Raw Normal View History

2024-10-22 18:39:54 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
2025-11-05 14:20:33 +01:00
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://openwebui.com/
2024-10-22 18:39:54 +02:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-10-22 18:39:54 +02:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
2025-11-05 14:20:33 +01:00
$STD apt install -y ffmpeg
2024-10-22 18:39:54 +02:00
msg_ok "Installed Dependencies"
2025-11-05 14:20:33 +01:00
USE_UVX="YES" PYTHON_VERSION="3.12" setup_uv
2024-10-22 18:39:54 +02:00
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Ollama"
curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz
tar -C /usr -xzf ollama-linux-amd64.tgz
rm -rf ollama-linux-amd64.tgz
cat <<EOF >/etc/systemd/system/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
Type=exec
ExecStart=/usr/bin/ollama serve
Environment=HOME=$HOME
Environment=OLLAMA_HOST=0.0.0.0
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now ollama
2025-11-05 14:20:33 +01:00
echo "ENABLE_OLLAMA_API=true" >/root/.env
msg_ok "Installed Ollama"
fi
2024-10-22 18:39:54 +02:00
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/open-webui.service
[Unit]
Description=Open WebUI Service
After=network.target
[Service]
2025-11-05 14:20:33 +01:00
Type=simple
EnvironmentFile=-/root/.env
Environment=DATA_DIR=/root/.open-webui
ExecStart=/usr/local/bin/uvx --python 3.12 open-webui@latest serve
WorkingDirectory=/root
Restart=on-failure
RestartSec=5
User=root
2024-10-22 18:39:54 +02:00
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now open-webui
2024-10-22 18:39:54 +02:00
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
2024-10-22 18:39:54 +02:00
msg_ok "Cleaned"