Compare commits

..

56 Commits

Author SHA1 Message Date
RomanNum3ral 3471657e35 Update 02-arch_install_1.sh 2026-06-09 23:50:20 +00:00
RomanNum3ral 32563e37d2 Update 02-arch_install_1.sh 2026-06-09 23:47:40 +00:00
RomanNum3ral 765740a5aa Update 02-arch_install_1.sh 2026-06-09 23:42:43 +00:00
RomanNum3ral db38795685 Update 02-arch_install_2.sh 2026-06-09 23:42:32 +00:00
RomanNum3ral 7ffceb68c8 Upload files to "/" 2026-06-09 23:42:11 +00:00
RomanNum3ral dc2d4bd4f6 Update 01-Ubuntu_install_2.sh 2026-06-09 23:41:12 +00:00
RomanNum3ral 54b03e2d69 Update 01-ubuntu_install_1.sh 2026-06-09 23:40:21 +00:00
RomanNum3ral c469fd27bc Update 01-install_2.sh 2026-02-23 23:10:35 +00:00
RomanNum3ral 6aa505c912 Add README.md 2025-11-28 01:10:52 +00:00
RomanNum3ral 0bd980dc9d Update 01-install_2.sh 2025-11-28 01:06:08 +00:00
RomanNum3ral 6998731ca7 Update 01-install_1.sh 2025-11-28 01:05:50 +00:00
RomanNum3ral 853d3ab5e1 Delete 01-nvidia_driver_install_v2.sh 2025-11-28 01:05:32 +00:00
RomanNum3ral baa7ab4e02 Delete 01-nvidia_driver_install.sh 2025-11-28 01:05:28 +00:00
RomanNum3ral 9d6034f3f6 Delete 01-fresh.sh 2025-11-28 01:05:23 +00:00
RomanNum3ral ee93597d9c Delete 02-fresh.sh 2025-11-28 01:05:18 +00:00
RomanNum3ral 773554eb1b Delete 02-ollama_install.sh 2025-11-28 01:05:13 +00:00
RomanNum3ral 826cec2b1b Delete 02-ollama_install_v2.sh 2025-11-28 01:05:07 +00:00
RomanNum3ral 8e900c04ab Delete 03-fresh.sh 2025-11-28 01:04:58 +00:00
RomanNum3ral f64b6453a5 Delete 03-stable_diffusion_install.sh 2025-11-28 01:04:54 +00:00
RomanNum3ral 124d848ef2 Delete 00-new2.sh 2025-11-28 01:04:49 +00:00
RomanNum3ral 46eb3b97b5 Delete 03-stable_diffusion_install_v3.sh 2025-11-28 01:04:45 +00:00
RomanNum3ral b13d493934 Delete docker-compose.yaml 2025-11-28 01:04:40 +00:00
RomanNum3ral fef8fb2cb5 Update 00-new3.sh 2025-11-28 00:44:57 +00:00
RomanNum3ral 4c8ec8f046 Delete README.md 2025-11-28 00:32:55 +00:00
RomanNum3ral ea7583dbea Update 00-new3.sh 2025-11-28 00:21:52 +00:00
RomanNum3ral 09f39209ab Update 00-new1.sh 2025-11-28 00:21:15 +00:00
RomanNum3ral ed27c7c8da Update 00-new1.sh 2025-11-28 00:17:13 +00:00
RomanNum3ral 258610fccf Add 00-new3.sh 2025-11-28 00:10:43 +00:00
RomanNum3ral 58168367e7 Add 00-new2.sh 2025-11-27 23:44:22 +00:00
RomanNum3ral 05b68689e0 Update 00-new1.sh 2025-11-27 23:43:43 +00:00
RomanNum3ral 10b1417d23 Add 00-new.sh 2025-11-27 23:29:21 +00:00
RomanNum3ral 85b8250326 Add 03-fresh.sh 2025-11-14 19:55:14 +00:00
RomanNum3ral 75ff675ff6 Add 02-fresh.sh 2025-11-14 19:54:41 +00:00
RomanNum3ral be2f2090ad Add 01-fresh.sh 2025-11-14 19:54:19 +00:00
RomanNum3ral 42de64e5e2 Update 02-ollama_install_v2.sh 2025-09-29 12:30:51 +00:00
RomanNum3ral c903dd3801 Update 01-nvidia_driver_install_v2.sh 2025-09-29 12:30:28 +00:00
RomanNum3ral f3f98cc23e Update 02-ollama_install_v2.sh 2025-09-29 12:29:24 +00:00
RomanNum3ral 42f2467d05 Update 02-ollama_install_v2.sh 2025-09-29 12:26:19 +00:00
RomanNum3ral a73a717f42 Update 01-nvidia_driver_install_v2.sh 2025-09-29 12:19:46 +00:00
RomanNum3ral 8fabf7b082 Update 02-ollama_install.sh 2025-09-29 12:17:27 +00:00
RomanNum3ral 1dd140dc04 Update 02-ollama_install_v2.sh 2025-09-29 12:15:44 +00:00
RomanNum3ral d3091536a2 Update 01-nvidia_driver_install_v2.sh 2025-09-29 12:09:16 +00:00
RomanNum3ral 3524ea2bd3 Add 03-stable_diffusion_install_v3.sh 2025-09-28 23:20:10 +00:00
RomanNum3ral 85e48b687f Add 02-ollama_install_v2.sh 2025-09-28 23:18:16 +00:00
RomanNum3ral 65646cf258 Add 01-nvidia_driver_install_v2.sh 2025-09-28 23:17:17 +00:00
RomanNum3ral 66ea1954a5 Delete install2_temp.sh 2025-09-17 18:39:18 +00:00
RomanNum3ral 096187dc50 Update 01-nvidia_driver_install.sh 2025-09-17 12:33:00 +00:00
RomanNum3ral 56ddef3e30 Update 02-ollama_install.sh 2025-09-17 12:32:32 +00:00
RomanNum3ral ef1a064128 Update 01-requirements.sh 2025-09-17 12:32:09 +00:00
RomanNum3ral 9034cb0195 Update 03-stable_diffusion_install.sh 2025-09-17 12:31:20 +00:00
RomanNum3ral 50acf44be1 Update install2_temp.sh 2025-04-13 16:31:46 +00:00
RomanNum3ral d714623df6 Update install1.sh 2025-04-13 16:28:31 +00:00
RomanNum3ral 9741fd18ec Update install2.sh 2025-04-13 16:28:12 +00:00
RomanNum3ral 909cb7d692 Update install3.sh 2025-04-13 16:27:49 +00:00
RomanNum3ral fe80a39e6a Update install1.sh 2025-04-13 16:27:26 +00:00
RomanNum3ral 40c3aaadaa Update install1.sh 2025-04-13 16:26:32 +00:00
10 changed files with 711 additions and 108 deletions

235
01-Ubuntu_install_2.sh Normal file
View File

@ -0,0 +1,235 @@
#!/usr/bin/env bash
set -euo pipefail
### CONFIG ###
OPENWEBUI_IMAGE="ghcr.io/open-webui/open-webui:main"
### /CONFIG ###
echo "=== Step 2: Install Docker, Ollama, Stable Diffusion, and Open WebUI ==="
if [[ $EUID -ne 0 ]]; then
echo "Please run this script as root, e.g.: sudo bash $0"
exit 1
fi
# Figure out the "real" user so we install things into their home directory
REALUSER="${SUDO_USER:-$USER}"
USER_HOME="$(eval echo ~${REALUSER})"
OPENWEBUI_DIR="${USER_HOME}/open-webui"
STABLEDIFF_DIR="${USER_HOME}/stablediff"
echo "Real user: ${REALUSER}"
echo "User home: ${USER_HOME}"
echo "Open WebUI dir: ${OPENWEBUI_DIR}"
echo "Stable Diff dir: ${STABLEDIFF_DIR}"
echo
# --- Sanity check: GPU should be visible now ---
if ! command -v nvidia-smi >/dev/null 2>&1; then
echo "WARNING: nvidia-smi not found."
echo "Make sure you ran 00-gpu-driver.sh and rebooted successfully."
echo "You can continue, but GPU usage may not work."
else
echo "nvidia-smi output:"
nvidia-smi || true
fi
###############################################################################
# Step 1/4: Install Docker Engine + Docker Compose
###############################################################################
echo
echo "Step 1/4: Installing Docker Engine + Docker Compose..."
# Remove old Docker bits if present (ignore errors)
apt-get remove -y docker docker-engine docker.io containerd runc || true
# Add Dockers official GPG key
install -m 0755 -d /etc/apt/keyrings
if [ ! -f /etc/apt/keyrings/docker.gpg ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
fi
# Add Docker apt repository
UBUNTU_CODENAME="$(. /etc/os-release && echo "$VERSION_CODENAME")"
if [ ! -f /etc/apt/sources.list.d/docker.list ]; then
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
${UBUNTU_CODENAME} stable" > /etc/apt/sources.list.d/docker.list
fi
apt-get update -y
apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
ocl-icd-opencl-dev \
opencl-headers
systemctl enable --now docker
echo "Docker version:"
docker --version || true
echo "Docker Compose plugin version:"
docker compose version || true
###############################################################################
# Step 2/4: Install Ollama (GPU-enabled)
###############################################################################
echo
echo "Step 2/4: Installing Ollama (GPU-enabled)..."
# Let Ollama's installer run even if its CUDA driver step conflicts with Ubuntu's drivers
set +e
curl -fsSL https://ollama.com/install.sh | sh
OLLAMA_RC=$?
set -e
if [ $OLLAMA_RC -ne 0 ]; then
echo "WARNING: Ollama installer returned non-zero (likely CUDA driver dependency issues)."
echo "As long as your NVIDIA driver works (nvidia-smi OK), you can ignore this."
fi
# Make sure the service is enabled & running
systemctl enable --now ollama || true
echo "Waiting for Ollama API on http://127.0.0.1:11434 ..."
for i in {1..30}; do
if curl -sSf http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "Ollama is up!"
break
fi
sleep 2
done
if ! curl -sSf http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "WARNING: Ollama API not responding yet. Check 'systemctl status ollama'."
fi
###############################################################################
# Step 3/4: Install Stable Diffusion (AUTOMATIC1111) via pyenv + systemd autostart
###############################################################################
echo
echo "Step 3/4: Installing Stable Diffusion WebUI (AUTOMATIC1111) with pyenv..."
echo "Installing prerequisites for Stable Diffusion..."
apt-get install -y \
make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git \
python3-pip
# Install pyenv for the REALUSER if not already present
sudo -u "${REALUSER}" bash -lc '
if [ ! -d "$HOME/.pyenv" ]; then
echo "Installing pyenv for $USER..."
curl https://pyenv.run | bash
else
echo "pyenv already installed for $USER, skipping."
fi
'
# Use pyenv to ensure Python 3.10 for Stable Diffusion
sudo -u "${REALUSER}" bash -lc '
export PYENV_ROOT="$HOME/.pyenv"
if [ -d "$PYENV_ROOT/bin" ]; then
export PATH="$PYENV_ROOT/bin:$PATH"
fi
eval "$(pyenv init -)"
echo "Ensuring Python 3.10 is installed with pyenv..."
pyenv install -s 3.10
pyenv global 3.10
'
# Clone AUTOMATIC1111s repo into ~/stablediff (if not already there)
sudo -u "${REALUSER}" bash -lc '
if [ ! -d "$HOME/stablediff" ]; then
echo "Cloning Stable Diffusion WebUI repo into ~/stablediff..."
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "$HOME/stablediff"
else
echo "~/stablediff already exists, skipping clone."
fi
'
# Create systemd service for Stable Diffusion WebUI to auto-start at boot
echo "Creating systemd service for Stable Diffusion WebUI..."
cat >/etc/systemd/system/stablediff.service <<EOF
[Unit]
Description=Stable Diffusion WebUI (AUTOMATIC1111)
After=network.target nvidia-persistenced.service
[Service]
Type=simple
User=${REALUSER}
WorkingDirectory=${STABLEDIFF_DIR}
Environment=PYENV_ROOT=${USER_HOME}/.pyenv
Environment=PATH=${USER_HOME}/.pyenv/shims:${USER_HOME}/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Environment=PYTHON=${USER_HOME}/.pyenv/shims/python
ExecStart=/bin/bash -lc './webui.sh --listen --api'
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now stablediff.service || true
echo "Stable Diffusion WebUI service created: stablediff.service"
echo "Check status with: systemctl status stablediff.service"
###############################################################################
# Step 4/4: Set up Open WebUI with Docker Compose (talking to Ollama)
###############################################################################
echo
echo "Step 4/4: Setting up Open WebUI with Docker Compose..."
mkdir -p "${OPENWEBUI_DIR}"
cd "${OPENWEBUI_DIR}"
cat > docker-compose.yml <<'EOF'
version: "3.8"
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
network_mode: "host"
environment:
- OLLAMA_BASE_URL=http://127.0.0.1:11434
# Uncomment to disable auth on local networks (optional, not recommended on exposed hosts)
# - OPENWEBUI_AUTH=False
volumes:
- ./data:/app/backend/data
EOF
echo "docker-compose.yml created at ${OPENWEBUI_DIR}/docker-compose.yml"
docker compose up -d
###############################################################################
# Done
###############################################################################
echo
echo "==================== ALL DONE ===================="
echo "Ollama service: systemctl status ollama"
echo "Stable Diffusion WebUI: systemctl status stablediff.service"
echo "Open WebUI stack: cd ${OPENWEBUI_DIR} && docker compose ps"
echo
echo "Web UIs:"
echo " Open WebUI (LLMs via Ollama): http://<your-server-ip>:8080"
echo " Stable Diffusion WebUI (images): http://<your-server-ip>:7860"
echo
echo "Stable Diffusion is configured to auto-start on boot via:"
echo " systemctl enable stablediff.service"
echo "==================================================="
ollama pull llama3.1:8b
ollama pull codellama:7b
ollama pull qwen2-math:7b

31
01-ubuntu_install_1.sh Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
echo "=== Step 1: NVIDIA driver install for RTX 3060 on Ubuntu 24.04 ==="
if [[ $EUID -ne 0 ]]; then
echo "Please run this script as root, e.g.: sudo bash $0"
exit 1
fi
echo "Updating apt and installing base dependencies..."
apt-get update -y
apt-get upgrade -y
apt-get install -y \
curl \
ca-certificates \
gnupg \
lsb-release \
apt-transport-https \
software-properties-common
echo
echo "Installing NVIDIA driver + utils (570)..."
# Desktop 570 stack: works fine on servers too and pulls in nvidia-smi
apt-get install -y nvidia-driver-570 nvidia-utils-570
echo
echo "Driver install finished."
echo "Now REBOOTING your server, then run: nvidia-smi"
echo "If nvidia-smi works, run the second script"
reboot now

201
02-arch_install_1.sh Normal file
View File

@ -0,0 +1,201 @@
#!/usr/bin/env bash
set -euo pipefail
echo "=== Smart NVIDIA driver install for RTX 3060 / RTX 3090 on Arch Linux ==="
if [[ ${EUID} -ne 0 ]]; then
echo "Please run as root, e.g.: sudo ./$0"
exit 1
fi
REALUSER="${SUDO_USER:-$USER}"
run() {
echo "+ $*"
"$@"
}
pkg_installed() {
pacman -Qq "$1" >/dev/null 2>&1
}
pkg_available() {
pacman -Si "$1" >/dev/null 2>&1
}
any_pkg_installed() {
local p
for p in "$@"; do
if pkg_installed "$p"; then return 0; fi
done
return 1
}
kernel_pkgs=()
header_pkgs=()
# Detect installed Arch kernels and match headers.
if pkg_installed linux; then
kernel_pkgs+=(linux)
header_pkgs+=(linux-headers)
fi
if pkg_installed linux-lts; then
kernel_pkgs+=(linux-lts)
header_pkgs+=(linux-lts-headers)
fi
if pkg_installed linux-zen; then
kernel_pkgs+=(linux-zen)
header_pkgs+=(linux-zen-headers)
fi
if pkg_installed linux-hardened; then
kernel_pkgs+=(linux-hardened)
header_pkgs+=(linux-hardened-headers)
fi
if [[ ${#kernel_pkgs[@]} -eq 0 ]]; then
echo "WARNING: Could not detect a standard Arch kernel package."
echo "This script will use DKMS because it is safest for custom kernels."
fi
echo
echo "Detected kernel packages: ${kernel_pkgs[*]:-(none detected)}"
echo "Required header packages: ${header_pkgs[*]:-(none detected)}"
echo
echo "Updating Arch package database and system..."
run pacman -Syu --noconfirm
echo
echo "Installing base dependencies..."
run pacman -S --needed --noconfirm \
curl ca-certificates gnupg lsb-release git base-devel linux-firmware pciutils
if [[ ${#header_pkgs[@]} -gt 0 ]]; then
echo
echo "Installing matching kernel headers..."
run pacman -S --needed --noconfirm "${header_pkgs[@]}"
fi
echo
echo "Checking NVIDIA GPU model..."
GPU_LINES="$(lspci -nn | grep -Ei 'vga|3d|display' | grep -Ei 'nvidia|geforce|rtx|gtx' || true)"
if [[ -z "$GPU_LINES" ]]; then
echo "WARNING: No NVIDIA GPU found by lspci. Continuing anyway."
else
echo "$GPU_LINES"
fi
# RTX 3060 and RTX 3090 are Ampere GPUs. Current Arch packages use open kernel modules
# for Turing and newer. Pascal/Maxwell need legacy 580xx from AUR, but that is NOT your GPU.
if echo "$GPU_LINES" | grep -Eiq 'RTX 3060|RTX 3090|GA10|Ampere|NVIDIA.*30[0-9][0-9]'; then
echo "Detected RTX 30-series/Ampere-class GPU: correct target is current nvidia-open stack."
else
echo "NOTE: I did not positively identify an RTX 3060/3090 from lspci text."
echo "If this machine has a 3060/3090 installed, the nvidia-open stack is still correct."
fi
# Choose driver flavor intelligently.
# - If nvidia-open is already installed, keep it unless non-standard kernels are installed without linux.
# - If multiple/alternate kernels are installed, DKMS is more flexible.
# - Do not install nvidia-open and nvidia-open-dkms together; they conflict.
DRIVER_PKG=""
if pkg_installed nvidia-open; then
DRIVER_PKG="nvidia-open"
echo
echo "Existing driver detected: nvidia-open. Keeping it."
elif pkg_installed nvidia-open-dkms; then
DRIVER_PKG="nvidia-open-dkms"
echo
echo "Existing driver detected: nvidia-open-dkms. Keeping it."
else
if [[ ${#kernel_pkgs[@]} -eq 1 && " ${kernel_pkgs[*]} " == *" linux "* ]]; then
DRIVER_PKG="nvidia-open"
else
DRIVER_PKG="nvidia-open-dkms"
fi
echo
echo "No existing NVIDIA open driver package detected. Selected: ${DRIVER_PKG}"
fi
# If the selected driver conflicts with an installed variant, remove only the conflicting variant.
if [[ "$DRIVER_PKG" == "nvidia-open" ]] && pkg_installed nvidia-open-dkms; then
echo "Removing conflicting package nvidia-open-dkms before installing nvidia-open..."
run pacman -Rns --noconfirm nvidia-open-dkms
fi
if [[ "$DRIVER_PKG" == "nvidia-open-dkms" ]] && pkg_installed nvidia-open; then
echo "Removing conflicting package nvidia-open before installing nvidia-open-dkms..."
run pacman -Rns --noconfirm nvidia-open
fi
# Remove old proprietary/legacy packages if present and conflicting.
old_pkgs=()
for p in nvidia nvidia-dkms nvidia-lts nvidia-580xx-dkms nvidia-580xx-utils nvidia-580xx-settings; do
if pkg_installed "$p"; then old_pkgs+=("$p"); fi
done
if [[ ${#old_pkgs[@]} -gt 0 ]]; then
echo "Removing old/conflicting NVIDIA packages: ${old_pkgs[*]}"
run pacman -Rns --noconfirm "${old_pkgs[@]}" || true
fi
echo
echo "Installing NVIDIA userspace + selected kernel module package..."
packages=("$DRIVER_PKG" nvidia-utils nvidia-settings opencl-nvidia egl-wayland vulkan-icd-loader)
if pacman -Si lib32-nvidia-utils >/dev/null 2>&1; then
packages+=(lib32-nvidia-utils lib32-vulkan-icd-loader)
fi
if [[ "$DRIVER_PKG" == "nvidia-open-dkms" ]]; then
packages+=(dkms)
fi
run pacman -S --needed --noconfirm "${packages[@]}"
echo
echo "Blacklisting nouveau just in case..."
cat >/etc/modprobe.d/blacklist-nouveau.conf <<'EON'
blacklist nouveau
options nouveau modeset=0
EON
# Enable early KMS for NVIDIA.
echo
echo "Configuring NVIDIA DRM modeset..."
cat >/etc/modprobe.d/nvidia.conf <<'EON'
options nvidia_drm modeset=1 fbdev=1
EON
# Rebuild initramfs.
echo
echo "Rebuilding initramfs..."
run mkinitcpio -P
# Enable persistence daemon if available.
if systemctl list-unit-files | grep -q '^nvidia-persistenced.service'; then
echo
echo "Enabling NVIDIA persistence daemon..."
run systemctl enable --now nvidia-persistenced.service || true
fi
echo
echo "Installed NVIDIA packages:"
pacman -Q | grep -E '^(nvidia|lib32-nvidia|opencl-nvidia|egl-wayland|vulkan-icd-loader|dkms) ' || true
echo
echo "Kernel in use: $(uname -r)"
echo
echo "Current NVIDIA module status before reboot:"
if command -v nvidia-smi >/dev/null 2>&1; then
nvidia-smi || true
else
echo "nvidia-smi not found yet."
fi
echo
echo "==================== DONE ===================="
echo "Driver package selected: ${DRIVER_PKG}"
echo "For RTX 3060 / RTX 3090 on current Arch, nvidia-open or nvidia-open-dkms is correct."
echo "Reboot now, then run: nvidia-smi"
echo "=============================================="

240
02-arch_install_2.sh Normal file
View File

@ -0,0 +1,240 @@
#!/usr/bin/env bash
set -euo pipefail
### CONFIG ###
OPENWEBUI_IMAGE="ghcr.io/open-webui/open-webui:main"
OLLAMA_MODELS=("llama3.1:8b" "codellama:7b" "qwen2-math:7b")
### /CONFIG ###
echo "=== Step 2: Install Docker, Ollama, Stable Diffusion, and Open WebUI on Arch Linux ==="
if [[ $EUID -ne 0 ]]; then
echo "Please run this script as root, e.g.: sudo bash $0"
exit 1
fi
if ! command -v pacman >/dev/null 2>&1; then
echo "This script is for Arch Linux. pacman was not found."
exit 1
fi
# Figure out the real user so user-owned app folders are created in their home directory.
REALUSER="${SUDO_USER:-$USER}"
USER_HOME="$(getent passwd "${REALUSER}" | cut -d: -f6)"
OPENWEBUI_DIR="${USER_HOME}/open-webui"
STABLEDIFF_DIR="${USER_HOME}/stablediff"
echo "Real user: ${REALUSER}"
echo "User home: ${USER_HOME}"
echo "Open WebUI dir: ${OPENWEBUI_DIR}"
echo "Stable Diff dir: ${STABLEDIFF_DIR}"
echo
# --- Sanity check: GPU should be visible now ---
if ! command -v nvidia-smi >/dev/null 2>&1; then
echo "WARNING: nvidia-smi not found."
echo "Make sure you ran the Arch NVIDIA driver script and rebooted."
echo "You can continue, but GPU usage may not work."
else
echo "nvidia-smi output:"
nvidia-smi || true
fi
###############################################################################
# Step 1/4: Install Docker Engine + Docker Compose
###############################################################################
echo
echo "Step 1/4: Installing Docker Engine + Docker Compose..."
pacman -Syu --noconfirm
pacman -S --needed --noconfirm \
docker \
docker-compose \
docker-buildx \
containerd \
ocl-icd \
opencl-headers
systemctl enable --now docker
# Allow the real user to run docker without sudo after logging out/in.
if id -nG "${REALUSER}" | grep -qw docker; then
echo "${REALUSER} is already in the docker group."
else
usermod -aG docker "${REALUSER}"
echo "Added ${REALUSER} to docker group. Log out/in for this to fully apply."
fi
echo "Docker version:"
docker --version || true
echo "Docker Compose version:"
docker compose version || docker-compose version || true
###############################################################################
# Step 2/4: Install Ollama
###############################################################################
echo
echo "Step 2/4: Installing Ollama..."
# Prefer the CUDA-enabled Arch package when available; fall back to plain ollama.
if pacman -Si ollama-cuda >/dev/null 2>&1; then
pacman -S --needed --noconfirm ollama-cuda
else
pacman -S --needed --noconfirm ollama
fi
systemctl enable --now ollama || true
echo "Waiting for Ollama API on http://127.0.0.1:11434 ..."
for i in {1..30}; do
if curl -sSf http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "Ollama is up!"
break
fi
sleep 2
done
if ! curl -sSf http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "WARNING: Ollama API not responding yet. Check: systemctl status ollama"
fi
###############################################################################
# Step 3/4: Install Stable Diffusion AUTOMATIC1111 via pyenv + systemd autostart
###############################################################################
echo
echo "Step 3/4: Installing Stable Diffusion WebUI AUTOMATIC1111 with pyenv..."
echo "Installing prerequisites for Stable Diffusion..."
pacman -S --needed --noconfirm \
base-devel \
openssl \
zlib \
bzip2 \
readline \
sqlite \
wget \
curl \
llvm \
ncurses \
xz \
tk \
libffi \
git \
python-pip \
pyenv
# Configure pyenv for the REALUSER if not already present.
sudo -u "${REALUSER}" bash -lc '
grep -q "PYENV_ROOT" "$HOME/.bashrc" 2>/dev/null || cat >> "$HOME/.bashrc" <<"BASHRC_EOF"
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
BASHRC_EOF
'
# Use pyenv to ensure Python 3.10 for Stable Diffusion.
sudo -u "${REALUSER}" bash -lc '
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:/usr/bin:$PATH"
eval "$(pyenv init -)"
echo "Ensuring Python 3.10 is installed with pyenv..."
pyenv install -s 3.10
pyenv global 3.10
'
# Clone AUTOMATIC1111 repo into ~/stablediff if needed.
sudo -u "${REALUSER}" bash -lc '
if [ ! -d "$HOME/stablediff" ]; then
echo "Cloning Stable Diffusion WebUI repo into ~/stablediff..."
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "$HOME/stablediff"
else
echo "~/stablediff already exists, skipping clone."
fi
'
# Create systemd service for Stable Diffusion WebUI to auto-start at boot.
echo "Creating systemd service for Stable Diffusion WebUI..."
cat >/etc/systemd/system/stablediff.service <<EOF_SERVICE
[Unit]
Description=Stable Diffusion WebUI AUTOMATIC1111
After=network-online.target nvidia-persistenced.service
Wants=network-online.target
[Service]
Type=simple
User=${REALUSER}
WorkingDirectory=${STABLEDIFF_DIR}
Environment=PYENV_ROOT=${USER_HOME}/.pyenv
Environment=PATH=${USER_HOME}/.pyenv/shims:${USER_HOME}/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Environment=PYTHON=${USER_HOME}/.pyenv/shims/python
ExecStart=/bin/bash -lc './webui.sh --listen --api'
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF_SERVICE
systemctl daemon-reload
systemctl enable --now stablediff.service || true
echo "Stable Diffusion WebUI service created: stablediff.service"
echo "Check status with: systemctl status stablediff.service"
###############################################################################
# Step 4/4: Set up Open WebUI with Docker Compose talking to Ollama
###############################################################################
echo
echo "Step 4/4: Setting up Open WebUI with Docker Compose..."
mkdir -p "${OPENWEBUI_DIR}"
chown -R "${REALUSER}:${REALUSER}" "${OPENWEBUI_DIR}"
cd "${OPENWEBUI_DIR}"
cat > docker-compose.yml <<EOF_COMPOSE
services:
open-webui:
image: ${OPENWEBUI_IMAGE}
container_name: open-webui
restart: unless-stopped
network_mode: "host"
environment:
- OLLAMA_BASE_URL=http://127.0.0.1:11434
# Uncomment to disable auth on local networks only. Do not expose this publicly with auth disabled.
# - OPENWEBUI_AUTH=False
volumes:
- ./data:/app/backend/data
EOF_COMPOSE
chown "${REALUSER}:${REALUSER}" docker-compose.yml
docker compose up -d
###############################################################################
# Pull starter Ollama models
###############################################################################
echo
echo "Pulling starter Ollama models..."
for model in "${OLLAMA_MODELS[@]}"; do
ollama pull "$model" || echo "WARNING: failed to pull $model"
done
###############################################################################
# Done
###############################################################################
echo
echo "==================== ALL DONE ===================="
echo "Ollama service: systemctl status ollama"
echo "Stable Diffusion WebUI: systemctl status stablediff.service"
echo "Open WebUI stack: cd ${OPENWEBUI_DIR} && docker compose ps"
echo
echo "Web UIs:"
echo " Open WebUI via Ollama: http://<your-server-ip>:8080"
echo " Stable Diffusion WebUI: http://<your-server-ip>:7860"
echo
echo "Note: if Docker permissions do not work for ${REALUSER}, log out and back in."
echo "==================================================="

View File

@ -1,3 +1,4 @@
7860 and 8080. This will install Ollama with the llama2 chat model. Install in your home directory. # Install Instructions
Install docker and Open WebUI to give the AI a GUI on port 8080 of what machine it is installed on
***If the install fails due to not seeing the graphics card (rtx nvidia) restart and try again*** - Run the install scripts in order
- You will need to create a cronjob for webui.sh with the arguments --listen --api

View File

@ -1,14 +0,0 @@
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
environment:
- OLLAMA_BASE_URL=http://127.0.0.1:11434
volumes:
- open-webui:/app/backend/data
network_mode: host
volumes:
open-webui:
external: false

View File

@ -1,38 +0,0 @@
#! /bin/bash
path=$PWD
sudo apt update
sudo apt upgrade -y
sudo ubuntu-drivers install --gpgpu
# install ollama
sudo curl -fsSL https://ollama.com/install.sh | sh
# Install Docker for OpenWebUI
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Install OpenWebUI the Docker container
cd $path
cd ../
mkdir docker-compose-files
cd docker-compose-files
mkdir open_web_ui
cd open_web_ui
wget https://wget-pulls.fortis-scientia.com/open_web_ui.yaml
sudo docker compose up -data
#sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
#sudo docker ps
# Add llama3.3 and codellama language model
ollama pull llama3.3:70b
ollama pull codellama:7b

View File

@ -1,28 +0,0 @@
#! /bin/bash
sudo apt update && sudo apt upgrade -y
sudo ubuntu-drivers install --gpgpu
# install ollama
sudo curl -fsSL https://ollama.com/install.sh | sh
# give it a web ui through Docker
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Install the Docker container
sudo docker compose up -d
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git pip
# Add llama3.3 and codellama language model
ollama pull llama3:8b
ollama pull codellama:7b
ollama pull qwen2-math:7b
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git pip

View File

@ -1,19 +0,0 @@
# Install prerequisites for Stable Diffusion
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git pip
# Install Stable Diffusion
curl https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
source .bashrc
pyenv install 3.10
pyenv global 3.10
cd
mkdir stablediff
cd stablediff
wget https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
sudo chmod +x webui.sh
./webui.sh --listen --api

View File

@ -1,6 +0,0 @@
#! /bin/bash
echo "blacklist nouveau" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
sudo reboot