Here is a comprehensive, summarized step-by-step guide for setting up your Open WebUI on an Ubuntu server, making it accessible online using your domain sayhi.us.
Summary
- Set up WSL and Ubuntu (if on Windows).
- Install Ollama and add a model.
- Monitor GPU performance (optional).
- Install Docker.
- Run Open WebUI Docker container.
- Install and configure Pyenv and Python.
- Install Stable Diffusion.
- Configure port forwarding on your router.4. Run on Phone and Computer
- Update DNS settings on GoDaddy.
- Set up Nginx as a reverse proxy (optional).
- Secure your site with SSL/TLS (optional).
Step-by-Step Guide
1. Set Up WSL and Ubuntu (If on Windows)
- Install WSL and Ubuntu:
wsl --install
- Connect to a WSL Instance in a New Window:
wsl -d Ubuntu
2. Install Ollama and Add a Model
- Download and Install Ollama:
Visit Ollama’s Download Page and follow the instructions. - Add a Model to Ollama:
ollama pull llama2
3. Monitor GPU Performance (Optional)
- Install NVIDIA Tools:
sudo apt-get install nvidia-driver-460 nvidia-cuda-toolkit
- Watch GPU Performance:
watch -n 0.5 nvidia-smi
4. Install Docker
- Add Docker’s Official GPG Key and Repository:
sudo apt-get update
sudo apt-get 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-get update
- Install Docker:
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
5. Run Open WebUI Docker Container
- Run the Container:
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
6. Install and Configure Pyenv and Python
- Install Pyenv Prerequisites:
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
- Install Pyenv:
curl https://pyenv.run | bash
- Configure Shell for Pyenv:
Add the following lines to your shell configuration file (~/.bashrcfor Bash):
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
source ~/.bashrc
- Install Python 3.10 with Pyenv:
pyenv install 3.10.0
pyenv global 3.10.0
- Verify Python Installation:
python --version # Should output Python 3.10.0
7. Install Stable Diffusion
- Download Stable Diffusion WebUI Script:
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
- Make the Script Executable:
chmod +x webui.sh
- Run the WebUI:
./webui.sh --listen --api
8. Configure Port Forwarding on Your Router
- Log into Your Router:
Access your router’s web interface (usuallyhttp://192.168.0.1). - Navigate to “Virtual Servers” and Add a New Rule:
- Name: OpenWebUI
- Interface: Default or as required
- External Port: 8080
- Internal Port: 8080
- Internal Server IP: 192.168.0.173
- Protocol: TCP
- Status: Enable
- Save/Apply the Rule
9. Update DNS Settings on GoDaddy
- Log into Your GoDaddy Account:
Access the DNS management page forsayhi.us. - Add/Edit the A Record:
- Name: @
- Value: 162.210.21.19 (your new static IP)
- TTL: 600 seconds
- Add/Edit the CNAME Record (if needed):
- Name: www
- Value: sayhi.us
- TTL: 1 Hour
10. Set Up Nginx as a Reverse Proxy (Optional but Recommended)
- Install Nginx:
sudo apt-get update
sudo apt-get install nginx
- Configure Nginx:
Create a new configuration file for your domain:
sudo nano /etc/nginx/sites-available/sayhi.us
Add the following content:
server {
listen 80;
server_name sayhi.us www.sayhi.us;
location / {
proxy_pass http://192.168.0.173:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
- Enable the Configuration:
sudo ln -s /etc/nginx/sites-available/sayhi.us /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
11. Secure Your Site with SSL/TLS (Optional but Recommended)
- Install Certbot:
sudo apt-get install certbot python3-certbot-nginx
- Obtain a Certificate:
sudo certbot --nginx -d sayhi.us -d www.sayhi.us
- Follow the On-Screen Instructions: Certbot will automatically configure SSL for your Nginx server.
- Set Up Automatic Renewal:
sudo certbot renew --dry-run
Final Testing and Verification
- Access Your Site:
Try accessing your site usinghttp://sayhi.usorhttp://www.sayhi.usto ensure the traffic is correctly routed to your internal server. - Check for Errors:
If there are issues, check the Nginx error logs:
sudo tail -f /var/log/nginx/error.log
By following these steps, you will have your Open WebUI set up and accessible via your domain sayhi.us.