Skip to content

Instantly share code, notes, and snippets.

@Limbicnation
Created October 15, 2024 12:44
Show Gist options
  • Select an option

  • Save Limbicnation/ad1fb7984983896808e772ff36a0a4ae to your computer and use it in GitHub Desktop.

Select an option

Save Limbicnation/ad1fb7984983896808e772ff36a0a4ae to your computer and use it in GitHub Desktop.
Run Open Web UI on Ubuntu 22.04
#!/bin/bash
# Define the directory where Open-WebUI is located
OPEN_WEBUI_DIR="$HOME/GitHub/open-webui"
# Define the port to run Open-WebUI on
WEBUI_PORT=7860 # Replace this with your desired port number
# Navigate to the Open-WebUI directory
if cd "$OPEN_WEBUI_DIR"; then
echo "Navigated to $OPEN_WEBUI_DIR"
else
echo "Error: Failed to navigate to $OPEN_WEBUI_DIR"
exit 1
fi
# Update the repository
echo "Fetching and pulling the latest changes from Git..."
if git fetch && git pull; then
echo "Repository successfully updated."
else
echo "Error: Failed to update repository."
exit 1
fi
# Activate the Conda environment
echo "Activating the conda environment 'open-webui'..."
if source "$(conda info --base)/etc/profile.d/conda.sh" && conda activate open-webui; then
echo "Conda environment 'open-webui' activated."
else
echo "Error: Failed to activate the conda environment 'open-webui'."
exit 1
fi
# Run the Open-WebUI server on the specified port
echo "Starting Open-WebUI on port $WEBUI_PORT..."
if open-webui serve --port "$WEBUI_PORT"; then
echo "Open-WebUI server started successfully on port $WEBUI_PORT."
else
echo "Error: Failed to start Open-WebUI server."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment