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.

SQLBot ships as a single Docker image that bundles the FastAPI backend, the frontend UI, and a PostgreSQL database. This guide walks you through deploying that image, connecting an LLM and a datasource, and running your first chat query.
You need a Linux server with Docker installed and a valid API key from at least one supported LLM provider.
1

Deploy SQLBot with Docker

Run the following command on your Linux server. It starts SQLBot in the background, maps the UI to port 8000 and the MCP server to port 8001, and mounts persistent volumes for data, logs, and uploaded files.
docker run -d \
  --name sqlbot \
  --restart unless-stopped \
  -p 8000:8000 \
  -p 8001:8001 \
  -v ./data/sqlbot/excel:/opt/sqlbot/data/excel \
  -v ./data/sqlbot/file:/opt/sqlbot/data/file \
  -v ./data/sqlbot/images:/opt/sqlbot/images \
  -v ./data/sqlbot/logs:/opt/sqlbot/app/logs \
  -v ./data/postgresql:/var/lib/postgresql/data \
  --privileged=true \
  dataease/sqlbot
Wait about 30 seconds for the application to initialize. You can monitor startup progress with:
docker logs -f sqlbot
Look for the line ✅ SQLBot 初始化完成 (SQLBot initialization complete) to confirm the app is ready.
You can also deploy SQLBot through the 1Panel app store or using an offline installation package for air-gapped environments.
2

Log in to the admin panel

Open your browser and navigate to:
http://<your-server-ip>:8000
Log in with the default credentials:
FieldValue
Usernameadmin
PasswordSQLBot@123456
Change the default admin password immediately after your first login. Navigate to your profile settings in the top-right corner.
3

Add an LLM model

SQLBot needs at least one configured LLM to generate SQL.
  1. In the sidebar, go to System Settings → AI Models.
  2. Click Add model.
  3. Select your LLM provider from the list (for example, DeepSeek or OpenAI).
  4. Enter your API key and select or type a model name (for example, deepseek-chat or gpt-4o).
  5. Click Test connection to verify the credentials, then click Save.
The first model you save becomes the default model used for all SQL generation.
Select OpenAI as the provider. Enter your sk-... API key and choose a model such as gpt-4o or gpt-4o-mini.
4

Connect a datasource

  1. In the sidebar, go to Datasources.
  2. Click Add datasource.
  3. Choose your database type (for example, MySQL, PostgreSQL, or ClickHouse).
  4. Fill in the connection details: host, port, database name, username, and password.
  5. Click Test connection, then click Save.
After saving, SQLBot reads the database schema and starts building embeddings for the tables and columns in the background. This enables schema retrieval during queries.
If your database has many tables, give the embedding process a minute or two to complete before running your first query. Embedding progress is shown on the datasource detail page.
5

Run your first chat query

  1. In the sidebar, click New chat.
  2. Select the datasource you just connected.
  3. Type a question in natural language, for example:
    Show me total sales by region for last month
    
  4. Press Enter. SQLBot will:
    • Retrieve the relevant table schema from the vector index
    • Construct a prompt and call the LLM to generate SQL
    • Execute the SQL against your database
    • Display the results as a data table and suggest a chart
Subsequent questions in the same chat session carry context from previous exchanges, so you can ask follow-up questions like “Break that down by product category” without repeating yourself.

What to do next

How it works

Understand the RAG + LLM pipeline behind every query.

Connect more datasources

Add MySQL, ClickHouse, Excel files, and more.

Improve accuracy

Add terminology entries and SQL training examples to make queries more accurate over time.

Embed or integrate

Expose SQLBot as an MCP server or embed it in your own web application.

Build docs developers (and LLMs) love