Install Ollama and Open webui on webmin or virtualmin

Step-by-Step Guide to Install Ollama with Open WebUI on Virtualmin

06/22/25  •  111 Tampilan

Cara & Gaya
121gamers avatar

### Step-by-Step Guide to Install Ollama with Open WebUI on Virtualmin

 

#### Prerequisites:

- **Domain**: `ai.paccione.co.uk` already live on your Virtualmin server

- **Server OS**: Ubuntu 22.04 LTS (adjust commands if using another distro)

- **Terminal Access**: SSH access with sudo privileges

 

---

 

### Step 1: Update System & Install Dependencies

```bash

sudo apt update && sudo apt upgrade -y

sudo apt install -y curl docker.io docker-compose npm nodejs

```

 

### Step 2: Install Ollama

```bash

curl -fsSL https://ollama.com/install.sh | sh

sudo systemctl enable ollama

sudo systemctl start ollama

```

 

### Step 3: Install Open WebUI

```bash

# Create directory

sudo mkdir -p /opt/open-webui && cd /opt/open-webui

 

# Create Docker Compose file

cat < docker-compose.yml

version: '3.8'

services:

  open-webui:

    image: ghcr.io/open-webui/open-webui:main

    ports:

      - "3000:8080"

    volumes:

      - open-webui:/app/backend/data

    environment:

      - OLLAMA_BASE_URL=http://host.docker.internal:11434

    depends_on:

      - ollama

    network_mode: host

 

  ollama:

    image: ollama/ollama

    volumes:

      - ollama:/root/.ollama

    network_mode: host

volumes:

  open-webui:

  ollama:

EOF

 

# Start Open WebUI

sudo docker-compose up -d

```

 

### Step 4: Create Virtualmin Proxy Service

1. In Virtualmin control panel:

   - Go to **Services > Configure Website** for `ai.paccione.co.uk`

   - Navigate to **Virtual Host > Proxy Website**

   - Configure:

     - **Proxy Path**: `/`

     - **Proxy to URL**: `http://localhost:3000`

     - Check **Set options below?**

     - **Proxy type**: Standard reverse proxy

   - Save changes

 

### Step 5: Configure Firewall

```bash

sudo ufw allow 22,80,443,11434/tcp

sudo ufw enable

```

 

### Step 6: Verify Installation

1. Access your WebUI: `https://ai.paccione.co.uk`

2. Create admin account when prompted

3. Test model download in WebUI:

   - Go to **Settings > Model**

   - Enter `mistral` in model name field

   - Click Download

 

### Step 7: Manage Services

- **Stop Open WebUI**:

  ```bash

  cd /opt/open-webui && sudo docker-compose down

  ```

- **Update Open WebUI**:

  ```bash

  cd /opt/open-webui

  sudo docker-compose pull

  sudo docker-compose up -d --force-recreate

  ```

- **View Ollama Logs**:

  ```bash

  sudo journalctl -u ollama -f

  ```

 

### Troubleshooting:

1. **WebUI not loading?** Check proxy configuration in Virtualmin

2. **Model download fails?** Verify Ollama is running:

   ```bash

   curl http://localhost:11434

   ```

   Should return `Ollama is running`

 

3. **Permission issues?** Add user to docker group:

   ```bash

   sudo usermod -aG docker $USER

   newgrp docker

   ```

 

> **Note**: Initial model downloads may take several minutes depending on model size and internet speed. Start with smaller models like `mistral` (4.1GB) before larger ones.

1 Komentar
Menampilkan lebih banyak

Artikel Terkait