2023-04-18 12:50:33 -03:00
Docker Compose is a way of installing and launching the web UI in an isolated Ubuntu image using only a few commands.
2026-03-04 22:59:45 -03:00
## Prerequisites
2023-11-17 19:52:30 -08:00
2026-03-04 22:59:45 -03:00
You need Docker Compose v2.17 or higher:
2023-04-18 12:50:33 -03:00
```
~$ docker compose version
2023-11-17 19:52:30 -08:00
Docker Compose version v2.21.0
2023-04-18 12:50:33 -03:00
```
2026-03-04 22:59:45 -03:00
Installation instructions: https://docs.docker.com/engine/install/
2023-11-17 19:52:30 -08:00
2026-03-04 22:59:45 -03:00
For NVIDIA GPUs, you also need the [NVIDIA Container Toolkit ](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html ).
2023-11-17 19:52:30 -08:00
2026-03-04 22:59:45 -03:00
## Quick start
2023-11-17 19:52:30 -08:00
2026-03-04 22:59:45 -03:00
There are four Docker variants available under `docker/` :
2023-05-24 00:35:53 +01:00
2026-03-04 22:59:45 -03:00
| Directory | GPU | Notes |
|-----------|-----|-------|
| `docker/nvidia` | NVIDIA | Requires NVIDIA Container Toolkit |
| `docker/amd` | AMD | Requires ROCm-compatible GPU |
| `docker/intel` | Intel Arc | Beta support |
| `docker/cpu` | None | CPU-only inference |
2023-05-24 00:35:53 +01:00
2026-03-04 22:59:45 -03:00
To launch (using NVIDIA as an example):
2023-04-18 17:47:43 +02:00
```bash
2026-03-04 22:59:45 -03:00
cd text-generation-webui/docker/nvidia
cp ../.env.example .env
# Optionally edit .env to customize ports, TORCH_CUDA_ARCH_LIST, etc.
2023-05-02 00:51:10 -03:00
docker compose up --build
2023-04-18 17:47:43 +02:00
```
2026-03-04 22:59:45 -03:00
The web UI will be available at `http://localhost:7860` .
2023-04-18 17:47:43 +02:00
2026-03-04 22:59:45 -03:00
## User data
2023-04-18 17:47:43 +02:00
2026-03-04 22:59:45 -03:00
Create a `user_data/` directory next to the `docker-compose.yml` to persist your models, characters, presets, and settings between container rebuilds:
2023-04-18 17:47:43 +02:00
2026-03-04 22:59:45 -03:00
```bash
mkdir -p user_data
2023-04-18 17:47:43 +02:00
```
2026-03-04 22:59:45 -03:00
This directory is mounted into the container at runtime. You can place a `CMD_FLAGS.txt` inside it to pass persistent flags to the web UI (e.g., `--api` ).
2023-04-18 17:47:43 +02:00
2026-03-04 22:59:45 -03:00
Models can be downloaded through the web UI's “Model” tab once it's running, and they will be saved to `user_data/models/` .
2023-05-24 00:35:53 +01:00
2023-10-21 19:15:54 -03:00
## Dedicated docker repository
2023-05-24 00:35:53 +01:00
2026-03-04 22:59:45 -03:00
An external repository maintains a docker wrapper for this project as well as several pre-configured 'one-click' `docker compose` variants. It can be found at: [Atinoda/text-generation-webui-docker ](https://github.com/Atinoda/text-generation-webui-docker ).