Skip to main content
Version: dev

Docker Compose Deployment

Deploy DB-GPT with MySQL using Docker Compose — a production-ready setup with persistent storage.

Prerequisites​

Quick start​

The root docker-compose.yml deploys DB-GPT with a MySQL database and SiliconFlow as the default LLM provider.

Step 1 — Set your API key​

export SILICONFLOW_API_KEY="your-siliconflow-api-key"

Get your key at SiliconFlow.

Step 2 — Start the services​

SILICONFLOW_API_KEY=${SILICONFLOW_API_KEY} docker compose up -d

You should see output like:

[+] Running 3/3
✔ Network dbgptnet Created 0.0s
✔ Container db-gpt-db-1 Started 0.2s
✔ Container db-gpt-webserver-1 Started 0.2s

Step 3 — Open the Web UI​

Visit http://localhost:5670 in your browser.

First start may take a moment

The webserver waits for MySQL to finish initializing. If it fails on first start, it will auto-restart. Check logs with docker logs db-gpt-webserver-1 -f.

What gets deployed​

The default docker-compose.yml creates:

ServiceImagePortPurpose
dbmysql/mysql-server3306MySQL database for metadata
webservereosphorosai/dbgpt-openai:latest5670DB-GPT application server

Common operations​

View logs​

# Webserver logs
docker logs db-gpt-webserver-1 -f

# Database logs
docker logs db-gpt-db-1 -f

Stop services​

docker compose down

Restart services​

docker compose restart

Reset everything (including data)​

docker compose down -v
warning

The -v flag removes all volumes, including the MySQL database. All data will be lost.

Customization​

Use a different config file​

Mount your own TOML config and override the startup command:

webserver:
image: eosphorosai/dbgpt-openai:latest
command: dbgpt start webserver --config /app/configs/your-config.toml
volumes:
- ./your-config.toml:/app/configs/your-config.toml

Mount local models​

For GPU deployments, mount a local models directory:

webserver:
volumes:
- /data/models:/app/models
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]

Other Compose examples​

DB-GPT ships with additional Compose files for specific scenarios:

FileUse case
docker-compose.ymlDefault proxy deployment with MySQL
docker/compose_examples/cluster-docker-compose.ymlMulti-worker cluster with GPU
docker/compose_examples/ha-cluster-docker-compose.ymlHigh-availability cluster
docker/compose_examples/dbgpt-oceanbase-docker-compose.ymlOceanBase database backend

Example:

docker compose -f docker/compose_examples/cluster-docker-compose.yml up -d

Next steps​

TopicLink
Cluster deploymentCluster
Docker (single container)Docker
Source code deploymentSource Code