mirror of
https://github.com/open-webui/docs.git
synced 2026-01-02 17:59:41 +07:00
107 lines
2.6 KiB
Markdown
107 lines
2.6 KiB
Markdown
# Docker Compose Setup
|
|
|
|
Using Docker Compose simplifies the management of multi-container Docker applications.
|
|
|
|
Docker Compose requires an additional package, `docker-compose-v2`.
|
|
|
|
:::warning
|
|
|
|
**Warning:** Older Docker Compose tutorials may reference version 1 syntax, which uses commands like `docker-compose build`. Ensure you use version 2 syntax, which uses commands like `docker compose build` (note the space instead of a hyphen).
|
|
|
|
:::
|
|
|
|
## Example `docker-compose.yml`
|
|
|
|
Here is an example configuration file for setting up Open WebUI with Docker Compose:
|
|
|
|
```yaml
|
|
services:
|
|
openwebui:
|
|
image: ghcr.io/open-webui/open-webui:main
|
|
ports:
|
|
- "3000:8080"
|
|
volumes:
|
|
- open-webui:/app/backend/data
|
|
volumes:
|
|
open-webui:
|
|
```
|
|
|
|
### Using Slim Images
|
|
|
|
For environments with limited storage or bandwidth, you can use the slim image variant that excludes pre-bundled models:
|
|
|
|
```yaml
|
|
services:
|
|
openwebui:
|
|
image: ghcr.io/open-webui/open-webui:main-slim
|
|
ports:
|
|
- "3000:8080"
|
|
volumes:
|
|
- open-webui:/app/backend/data
|
|
volumes:
|
|
open-webui:
|
|
```
|
|
|
|
:::note
|
|
|
|
**Note:** Slim images download required models (whisper, embedding models) on first use, which may result in longer initial startup times but significantly smaller image sizes.
|
|
|
|
:::
|
|
|
|
## Starting the Services
|
|
|
|
To start your services, run the following command:
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
## Helper Script
|
|
|
|
A useful helper script called `run-compose.sh` is included with the codebase. This script assists in choosing which Docker Compose files to include in your deployment, streamlining the setup process.
|
|
|
|
---
|
|
|
|
:::note
|
|
|
|
**Note:** For Nvidia GPU support, you change the image from `ghcr.io/open-webui/open-webui:main` to `ghcr.io/open-webui/open-webui:cuda` and add the following to your service definition in the `docker-compose.yml` file:
|
|
|
|
:::
|
|
|
|
```yaml
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
- count: all
|
|
capabilities: [gpu]
|
|
```
|
|
|
|
This setup ensures that your application can leverage GPU resources when available.
|
|
|
|
## Uninstall
|
|
|
|
To uninstall Open WebUI running with Docker Compose, follow these steps:
|
|
|
|
1. **Stop and Remove the Services:**
|
|
Run this command in the directory containing your `docker-compose.yml` file:
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
2. **Remove the Volume (Optional, WARNING: Deletes all data):**
|
|
If you want to completely remove your data (chats, settings, etc.):
|
|
```bash
|
|
docker compose down -v
|
|
```
|
|
Or manually:
|
|
```bash
|
|
docker volume rm <your_project_name>_open-webui
|
|
```
|
|
|
|
3. **Remove the Image (Optional):**
|
|
```bash
|
|
docker rmi ghcr.io/open-webui/open-webui:main
|
|
```
|