Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dataease/SQLBot/llms.txt

Use this file to discover all available pages before exploring further.

Docker Compose gives you a version-controlled, reproducible deployment definition. It is recommended when you want to customize environment variables, integrate with an existing Docker network, or manage SQLBot alongside other services. The Compose file is the source of truth for all runtime configuration.

Prerequisites

  • Docker Engine 20.10 or later with the Compose plugin (docker compose) or standalone docker-compose v2.
  • A Linux server with at least 2 CPU cores and 4 GB of RAM.

Deployment

1

Download the Compose file

Save the following file as docker-compose.yaml in a directory of your choice (for example, /opt/sqlbot).
services:
  sqlbot:
    image: dataease/sqlbot
    container_name: sqlbot
    restart: always
    privileged: true
    networks:
      - sqlbot-network
    ports:
      - 8000:8000
      - 8001:8001
    environment:
      # Database configuration
      POSTGRES_SERVER: localhost
      POSTGRES_PORT: 5432
      POSTGRES_DB: sqlbot
      POSTGRES_USER: root
      POSTGRES_PASSWORD: Password123@pg
      # Project basic settings
      PROJECT_NAME: "SQLBot"
      DEFAULT_PWD: "SQLBot@123456"
      # MCP settings
      SERVER_IMAGE_HOST: http://YOUR_SERVE_IP:MCP_PORT/images/
      # Auth & Security
      SECRET_KEY: y5txe1mRmS_JpOrUzFzHEu-kIQn3lf7ll0AOv9DQh0s
      # CORS settings
      BACKEND_CORS_ORIGINS: "http://localhost,http://localhost:5173,https://localhost,https://localhost:5173"
      # Logging
      LOG_LEVEL: "INFO"
      SQL_DEBUG: False
    volumes:
      - ./data/sqlbot/excel:/opt/sqlbot/data/excel
      - ./data/sqlbot/file:/opt/sqlbot/data/file
      - ./data/sqlbot/images:/opt/sqlbot/images
      - ./data/sqlbot/logs:/opt/sqlbot/app/logs
      - ./data/postgresql:/var/lib/postgresql/data

networks:
  sqlbot-network:
2

Customize required environment variables

Before starting the stack, update the variables listed below. The defaults are intentionally insecure and must not be used in production.
You must change SECRET_KEY, POSTGRES_PASSWORD, and DEFAULT_PWD before running in any environment that is accessible over a network. The shipped defaults are publicly known.
VariableWhat to change it to
SECRET_KEYGenerate a new value: python3 -c "import secrets; print(secrets.token_urlsafe(32))"
POSTGRES_PASSWORDA strong password for the embedded PostgreSQL instance.
DEFAULT_PWDThe initial password assigned to new non-admin users.
BACKEND_CORS_ORIGINSThe actual origins from which your browser will access SQLBot.
SERVER_IMAGE_HOSTThe public URL of your server, used to serve MCP-generated chart images.
3

Start the stack

docker compose up -d
To follow the startup logs:
docker compose logs -f
The stack is ready when you see uvicorn report that the application started on port 8000.
4

Open the web UI

Navigate to http://<your-server-ip>:8000 and log in with:
  • Username: admin
  • Password: SQLBot@123456
Change the admin password immediately from the profile settings page.

Environment variable reference

Database

These variables configure the connection to the embedded PostgreSQL instance. If you set POSTGRES_SERVER to a remote host, the container will connect to an external database instead of the bundled one.
VariableDefaultDescription
POSTGRES_SERVERlocalhostHostname or IP of the PostgreSQL server.
POSTGRES_PORT5432TCP port PostgreSQL listens on.
POSTGRES_DBsqlbotName of the database SQLBot will use.
POSTGRES_USERrootPostgreSQL username.
POSTGRES_PASSWORDPassword123@pgPostgreSQL password. Change before deploying.

Application

VariableDefaultDescription
PROJECT_NAMESQLBotDisplay name shown in the web UI header.
DEFAULT_PWDSQLBot@123456Default password assigned to newly created non-admin users. Change before deploying.

Security

VariableDefaultDescription
SECRET_KEYy5txe1mRmS_JpOrUzFzHEu-kIQn3lf7ll0AOv9DQh0sKey used to sign JWT authentication tokens. Changing this value invalidates all active sessions. Change before deploying.

CORS

VariableDefaultDescription
BACKEND_CORS_ORIGINShttp://localhost,http://localhost:5173,https://localhost,https://localhost:5173Comma-separated list of origins the browser is allowed to send requests from. Include your production domain (e.g., https://sqlbot.example.com).

MCP server

VariableDefaultDescription
SERVER_IMAGE_HOSThttp://YOUR_SERVE_IP:MCP_PORT/images/Base URL used to construct public links to chart images generated by the MCP server. Replace with your actual server address and port 8001.

Logging

VariableDefaultDescription
LOG_LEVELINFOApplication log verbosity. Accepted values: DEBUG, INFO, WARNING, ERROR.
SQL_DEBUGFalseWhen set to True, all SQL statements executed by the ORM are written to the application log. Useful for troubleshooting data issues.

Managing the stack

# Stop all services
docker compose down

# Restart with updated environment variables
docker compose down && docker compose up -d

# Pull the latest image and redeploy
docker compose pull && docker compose up -d

Build docs developers (and LLMs) love