Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Created October 8, 2024 11:06
Show Gist options
  • Save random-robbie/8a719daabe6b64d61fa545788940ff8f to your computer and use it in GitHub Desktop.
Save random-robbie/8a719daabe6b64d61fa545788940ff8f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Update Homebrew
brew update
# Install Python 3.11 if not already installed
brew install [email protected]
# Create a virtual environment
python3.11 -m venv openweb-ui-env
# Activate the virtual environment
source openweb-ui-env/bin/activate
# Upgrade pip
pip install --upgrade pip
# Clone git repo
git clone https://github.com/open-webui/open-webui.git
# Install OpenWeb-UI
pip install ./openweb-ui
# Create a script to run OpenWeb-UI
cat <<EOF > run_openweb_ui.sh
#!/bin/bash
source $(pwd)/openweb-ui-env/bin/activate
open-webui servei --port 3333
EOF
# Make the run script executable
chmod +x run_openweb_ui.sh
# Create a launch agent for starting on boot
cat <<EOF > ~/Library/LaunchAgents/com.user.openwebui.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.openwebui</string>
<key>ProgramArguments</key>
<array>
<string>$(pwd)/run_openweb_ui.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOF
# Load the launch agent
launchctl load ~/Library/LaunchAgents/com.user.openwebui.plist
echo "OpenWeb-UI has been installed and will run on port 3333 at startup."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment