# Open WebUI

Installing Open WebUI on Linux Machines

# Installing Open WebUI 5.20 on Ubuntu 22.04

- Install Ubuntu 24.04. (Note to have sufficient storage for the models)
- Update the ubuntu system to ensure all are up to date before installig the open-webui

```
sudo apt update -y && sudo apt upgrade -y
```

#### **Install the Ollama**

1\. Download the installation script for Ollama

```
wget https://ollama.ai/install.sh
```

2\. Make the script executable

```
sudo chmod +x install.sh
```

3\. Run the installation script of Ollama

```
sudo ./install.sh
```

[![Screenshot 2025-03-16 at 18.11.43.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/0qPkzX79zjwOoK0o-screenshot-2025-03-16-at-18-11-43.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/0qPkzX79zjwOoK0o-screenshot-2025-03-16-at-18-11-43.png)

4\. Enable the Ollama service to start at boot using systemctl.

```
sudo systemctl enable ollama
```

5\. Start the Ollama service using systemctl.

```
sudo systemctl start ollama
```

6\. Check if the Ollama service is running.

```
sudo systemctl status ollama
```

[![Screenshot 2025-03-16 at 18.14.50.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/3bDNvMdMf2OruHvF-screenshot-2025-03-16-at-18-14-50.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/3bDNvMdMf2OruHvF-screenshot-2025-03-16-at-18-14-50.png)

7\. Install models for Ollama.

**model llama3:8b**

```
sudo ollama pull llama3:8b
```

[![Screenshot 2025-03-16 at 18.30.09.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/qbCZANDyADNUT06c-screenshot-2025-03-16-at-18-30-09.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/qbCZANDyADNUT06c-screenshot-2025-03-16-at-18-30-09.png)

**model mistral**

```
sudo ollama pull mistral
```

[![Screenshot 2025-03-16 at 18.34.07.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/1Jm2zIpqslqGpWTR-screenshot-2025-03-16-at-18-34-07.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/1Jm2zIpqslqGpWTR-screenshot-2025-03-16-at-18-34-07.png)

**model llama3:70b**

```
sudo ollama pull llama3:70b
```

#### **Install the Open WebUI using python 3.11**

1\. Install the python 3.11.

```
sudo apt install python3.11
```

[![Screenshot 2025-03-16 at 18.43.30.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/Ely8vV4q36I92PN3-screenshot-2025-03-16-at-18-43-30.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/Ely8vV4q36I92PN3-screenshot-2025-03-16-at-18-43-30.png)

2\. Install the python3-pip

```
sudo python3.11 -m pip install open-webui
```

[![Screenshot 2025-03-16 at 18.47.09.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/DtI6Ogn3pWjx0eX2-screenshot-2025-03-16-at-18-47-09.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/DtI6Ogn3pWjx0eX2-screenshot-2025-03-16-at-18-47-09.png)

3\. Install Open WebUI using python 3.11.

```
sudo python3.11 -m pip install open-webui
```

[![Screenshot 2025-03-16 at 18.54.15.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/MWVG94YtoX3CE3me-screenshot-2025-03-16-at-18-54-15.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/MWVG94YtoX3CE3me-screenshot-2025-03-16-at-18-54-15.png)

4\. Install the python packages Pillow and pyopenssl

```
sudo python3.11 -m pip install -U Pillow pyopenssl
```

[![Screenshot 2025-03-16 at 18.55.42.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/7U0BkUC0uccT2SWB-screenshot-2025-03-16-at-18-55-42.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/7U0BkUC0uccT2SWB-screenshot-2025-03-16-at-18-55-42.png)

5\. Run the open-webui to test if it is working and then stop it with **"CTRL + C".**

```
sudo open-webgui serve
```

[![Screenshot 2025-03-16 at 18.57.40.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/bOBJqBbmXJGUjD0C-screenshot-2025-03-16-at-18-57-40.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/bOBJqBbmXJGUjD0C-screenshot-2025-03-16-at-18-57-40.png)

6\. Create a service for open-webui **openwebui.service**,

```
sudo nano /usr/lib/systemd/system/openwebui.service
```

7\. Paste the following information in the file openwebui.service.

```
[Unit]
Description=Open WebUI Service
After=network.target

[Service]
Type=simple
ExecStart=open-webui serve
ExecStop=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
```

8\. Reload the daemon.

```
sudo systemctl daemon-reload
```

9\. Enable the openwebui.service using the systemctl.

```
sudo systemctl enable openwebui.service
```

10\. Start the openwebui service.

```
sudo systemctl start openwebui
```

11\. Ce¡heck the status of the Open WebUI service.

```
sudo systemctl status openwebui
```

[![Screenshot 2025-03-16 at 19.17.03.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/r2bmQu1uuMUHrj2f-screenshot-2025-03-16-at-19-17-03.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/r2bmQu1uuMUHrj2f-screenshot-2025-03-16-at-19-17-03.png)

#### **Install nginx to proxy the port 8080 to port 80 or 443.**

1\. Install the Nigin.

```
sudo apt install nginx -y
```

2\. Start the nginx service.

```
sudo systemctl start nginx
```

3\. Create a site configuration in the site-available directory of nginx, `/etc/nginx/sites-available/openwebui.conf.`

```
sudo vim /etc/nginx/sites-available/openwebui.conf
```

4\. Paste the following data and then save the file.

```
server {
    listen 80;
    server_name openwebuiHP.homehaktrak.local openwebuiHP;

    access_log /var/log/nginx/openwebui_access.log;
    error_log /var/log/nginx/openwebui_error.log;

    location / {
        proxy_pass http://127.0.0.1:8080;

        client_max_body_size 300M;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;


        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_send_timeout 300;

        # (Optional) Disable proxy buffering for better streaming response from models
        proxy_buffering off;

    }
}
```

5\. Make a soft link for the openwebui.conf file from the site-available to the site-enabled

```
sudo ln -s /etc/nginx/sites-available/openwebui.conf /etc/nginx/sites-enabled/openwebui.conf
```

6\. Test the configuration and reload teh nginx service.

```
sudo nginx -t && sudo systemctl restart nginx
```

7\. Before accesing the IP forport 80, we have to edit the /etc/hosts fiel.

```
sudo nano /etc/hosts
```

8\. Paste the following in the /etc/hosts file.

```
IP_OF_SERVER  openwebui openwebui.homehaktrak.local
```

[![Screenshot 2025-03-16 at 19.29.48.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/CtFO9IZTwA6UXfMF-screenshot-2025-03-16-at-19-29-48.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/CtFO9IZTwA6UXfMF-screenshot-2025-03-16-at-19-29-48.png)

9\. test the configuration and if there are no errors then the service will be restarted.

```
sudo nginx -t && sudo systemctl restart nginx
```

#### **Using the browser prefered**

1\. Openn the browser.

[![Screenshot 2025-03-16 at 19.46.37.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/JnEQYA1V9jl0Z2MW-screenshot-2025-03-16-at-19-46-37.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/JnEQYA1V9jl0Z2MW-screenshot-2025-03-16-at-19-46-37.png)

2\. Press **"Get Started", and the next slide will ask a "Name", "email", and a "Password".**

[![Screenshot 2025-03-16 at 19.48.35.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/r0sgQOpLMtt40W6o-screenshot-2025-03-16-at-19-48-35.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/r0sgQOpLMtt40W6o-screenshot-2025-03-16-at-19-48-35.png)

3\. Press Create "**Admin Account"**.

[![Screenshot 2025-03-16 at 19.50.11.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/Ay4AeARs94u5XuFu-screenshot-2025-03-16-at-19-50-11.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/Ay4AeARs94u5XuFu-screenshot-2025-03-16-at-19-50-11.png)

4\. Start the webui.

[![Screenshot 2025-03-16 at 19.51.26.png](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/scaled-1680-/PdJP5NlLD1uLSPUT-screenshot-2025-03-16-at-19-51-26.png)](https://nacinocomputernetworks.com/uploads/images/gallery/2025-03/PdJP5NlLD1uLSPUT-screenshot-2025-03-16-at-19-51-26.png)