* cloud doc

* doc refactor

* doc move

* seo

* remove doc

* yml

* doc

* fix: tsconfig

* fix: tsconfig
This commit is contained in:
Archer
2026-03-03 17:39:47 +08:00
committed by GitHub
parent 6b61359516
commit 87b0bca30c
356 changed files with 1274 additions and 1383 deletions
@@ -0,0 +1,405 @@
---
title: Deploy with Docker-compose
description: Quickly deploy FastGPT using Docker Compose
---
import { Alert } from '@/components/docs/Alert';
## Prerequisites
1. Basic networking knowledge: ports, firewalls, etc.
2. Docker and Docker Compose basics
## Deployment Architecture
![](/imgs/sealos-fastgpt.webp)
<Alert icon="🤖" context="success">
- MongoDB: Stores all data except vectors
- PostgreSQL/Milvus/Oceanbase/SeekDB: Stores vector data
- AIProxy: Aggregates various AI APIs with multi-model support (for any model issues, test with OneAPI first)
</Alert>
## Recommended Specs
### PgVector Version
Very lightweight, suitable for knowledge base indexes under 50 million.
| Environment | Minimum (Single Node) | Recommended |
| ---------------------------------- | --------------------- | ------------ |
| Testing (reduce compute processes) | 2c4g | 2c8g |
| 1M vector groups | 4c8g 50GB | 4c16g 50GB |
| 5M vector groups | 8c32g 200GB | 16c64g 200GB |
### Milvus Version
Better performance for 100M+ vectors.
[View Milvus official recommended specs](https://milvus.io/docs/prerequisite-docker.md)
| Environment | Minimum (Single Node) | Recommended |
| ---------------- | --------------------- | ----------- |
| Testing | 2c8g | 4c16g |
| 1M vector groups | Not tested | |
| 5M vector groups | | |
### Zilliz Cloud Version
Zilliz Cloud is built by the Milvus team — a fully managed SaaS vector database with better performance than Milvus and SLA guarantees. [Try Zilliz Cloud](https://zilliz.com.cn/).
Since the vector database runs in the cloud, no local resources are needed.
### SeekDB Version
SeekDB is a high-performance vector database based on MySQL protocol, fully compatible with OceanBase, supporting efficient vector retrieval.
| Environment | Minimum (Single Node) | Recommended |
| ---------------------------------- | --------------------- | ------------ |
| Testing (reduce compute processes) | 2c4g | 2c8g |
| 1M vector groups | 4c8g 50GB | 4c16g 50GB |
| 5M vector groups | 8c32g 200GB | 16c64g 200GB |
<Alert icon="🤖" context="success">
SeekDB uses MySQL protocol, fully compatible with OceanBase:
- Supports 1536-dimensional vector retrieval
- Built-in HNSW index algorithm
- Batch insert and query optimization
- Automatic retry and connection pool management
</Alert>
## Preparation
### Prepare Docker Environment
<Tabs items={['Linux','MacOS','Windows']}>
<Tab value="Linux">
```bash
# Install Docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
systemctl enable --now docker
# Install docker-compose
curl -L https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Verify installation
docker -v
docker-compose -v
# If it fails, search online for solutions
```
</Tab>
<Tab value="MacOS">
We recommend [Orbstack](https://orbstack.dev/). Install via Homebrew:
```bash
brew install orbstack
```
Or [download the installer](https://orbstack.dev/download) directly.
</Tab>
<Tab value="Windows">
We recommend storing source code and data in the Linux filesystem when binding to Linux containers, not the Windows filesystem.
You can [install Docker Desktop with WSL 2 backend on Windows](https://docs.docker.com/desktop/wsl/).
Or [install the command-line version of Docker directly in WSL 2](https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop).
</Tab>
</Tabs>
## Start Deployment
### 1. Get Configuration Files
#### Method 1: Interactive Script Deployment
Run in Linux/MacOS/Windows WSL. The script guides you through selecting deployment environment, vector database version, IP address, etc.
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
#### Method 2: Manual Download
If your environment is non-*nix or can't access external networks, manually download `docker-compose.yml`.
1. Download the `docker-compose.yml` file:
<details>
<summary>Click to view docker-compose config file download links for different databases</summary>
- **Pgvector**
- China mirror (Alibaba Cloud): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.pg.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.pg.yml)
- **Oceanbase**
- China mirror (Alibaba Cloud): [docker-compose.ob.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.ob.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.ob.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.ob.yml)
- **Milvus**
- China mirror (Alibaba Cloud): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.milvus.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.milvus.yml)
- **Zilliz**
- China mirror (Alibaba Cloud): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.zilliz.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.zilliz.yml)
- **SeekDB**
- China mirror (Alibaba Cloud): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.seekdb.yml)
- Global mirror (dockerhub, ghcr): [docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.seekdb.yml)
2. Download the `config.json` file:
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
</details>
Download config.json file:
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
### 2. Modify Environment Variables
For `Zilliz version`, you also need credentials — see [Deploy Zilliz Version: Get Account and Credentials](#deploy-zilliz-version-get-account-and-credentials). Other versions can skip to the next step.
### 3. Open External Ports / Configure Domain
These ports must be accessible:
1. Port 3000 (FastGPT main service)
2. Port 9000 (S3 service)
1. Port 3005 (FastGPT SSE MCP server service)
### 4. Start Containers
Run in the same directory as docker-compose.yml. Ensure `docker-compose` version is 2.17+, or automated commands may fail.
```bash
# Start containers
docker-compose up -d
```
### 5. Access FastGPT
Access FastGPT via the port/domain opened in step 3.
Login username is `root`, password is the `DEFAULT_ROOT_PSW` set in `docker-compose.yml` environment variables.
Each container restart automatically initializes the root user with password `1234` (matching `DEFAULT_ROOT_PSW`).
### 6. Configure Models
- After first login, the system prompts that `Language Model` and `Index Model` are not configured and automatically redirects to the model configuration page. At least these two model types are required.
- If the redirect doesn't happen, go to `Account - Model Providers` to configure models. [View tutorial](/docs/self-host/config/model/ai-proxy)
- Known issue: after first entering the system, the browser tab may become unresponsive. Close the tab and reopen it.
### 7. Install System Plugins as Needed
Starting from V4.14.0, the fastgpt-plugin image only provides the runtime environment without pre-installed system plugins. All FastGPT systems must manually install system plugins.
* Install via the plugin marketplace — by default it fetches from the public FastGPT Marketplace.
* If your FastGPT can't access the marketplace, visit [FastGPT Plugin Marketplace](https://marketplace.fastgpt.cn/), download .pkg files, and import them via file upload.
* You can also sort tools, set default installations, and manage tags.
![alt text](/imgs/image-121.png)
## FAQ
### FastGPT and FastGPT-plugin Version Compatibility
| FastGPT-plugin Version | FastGPT Main Service |
| ---------------------- | -------------------- |
| 0.5.x | >= 4.14.6 |
| < 0.5.0 | < 4.14.6 |
### S3 Connection Issues
Check the `STORAGE_EXTERNAL_ENDPOINT` variable — it must be accessible by both the client and FastGPT service.
**Important:**
> Don't use `127.0.0.1` or `localhost` or other loopback addresses. Use the host machine's local IP when deploying with Docker, but set it to a static IP; or use a fixed domain name. This prevents 403 errors caused by URL mismatches when signing object storage URLs.
>
> See [Object Storage Configuration & Common Issues](/docs/self-host/config/object-storage)
### Browser Unresponsive After Login
Can't click anything, refresh doesn't help. Close the tab and reopen it.
### Mongo Replica Set Auto-Initialization Failed
The latest docker-compose examples have fully automated Mongo replica set initialization. Tested on Ubuntu 20/22, CentOS 7, WSL2, macOS, and Windows. If it still won't start, the CPU likely doesn't support AVX instructions — switch to Mongo 4.x.
To manually initialize the replica set:
1. Create a mongo key in the terminal:
```bash
openssl rand -base64 756 > ./mongodb.key
chmod 600 ./mongodb.key
# Change key permissions — some systems use admin, others use root
chown 999:root ./mongodb.key
```
2. Modify docker-compose.yml to mount the key:
```yml
mongo:
# image: mongo:5.0.18
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # Alibaba Cloud
container_name: mongo
ports:
- 27017:27017
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
# Default username and password, only effective on first run
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
- ./mongodb.key:/data/mongodb.key
```
3. Restart services:
```bash
docker-compose down
docker-compose up -d
```
4. Enter the container and initialize the replica set:
```bash
# Check if mongo container is running
docker ps
# Enter container
docker exec -it mongo bash
# Connect to database (use your Mongo username and password)
mongo -u myusername -p mypassword --authenticationDatabase admin
# Initialize replica set. For external access, add directConnection=true to the Mongo connection parameters
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
# Check status — if it shows rs0 status, it's running successfully
rs.status()
```
### How to Change API Address and Key
By default, OneAPI connection address and key are configured. Modify the environment variables in the fastgpt container in `docker-compose.yml`:
`OPENAI_BASE_URL` (API endpoint, must include /v1)
`CHAT_API_KEY` (API credentials)
After modifying, restart:
```bash
docker-compose down
docker-compose up -d
```
### How to Update Versions?
1. Check the [update documentation](/docs/self-host/upgrading/upgrade-intruction) to confirm the target version — avoid skipping versions.
2. Change the image tag to the target version
3. Run these commands to pull and restart:
```bash
docker-compose pull
docker-compose up -d
```
4. Run initialization scripts (if any)
### How to Customize Configuration Files?
Modify `config.json`, then run `docker-compose down` followed by `docker-compose up -d` to restart. For details, see [Configuration Guide](/docs/self-host/config/json).
### How to Check if Custom Config File is Mounted
1. `docker logs fastgpt` shows logs. After starting the container, the first web request reads the config file — check for success or error messages.
2. `docker exec -it fastgpt sh` enters the container. Use `ls data` to check if `config.json` is mounted. Use `cat data/config.json` to view it.
**Possible reasons it's not working:**
1. Incorrect mount directory
2. Invalid config file — logs will show `invalid json`. The file must be valid JSON.
3. Didn't run `docker-compose down` then `docker-compose up -d` after changes. A simple restart doesn't remount files.
### How to Check if Environment Variables Loaded
1. `docker exec -it fastgpt sh` to enter the container.
2. Run `env` to view all environment variables.
### Why Can't I Connect to Local Model Images
`docker-compose.yml` uses bridge mode to create the `fastgpt` network. To access other images via 0.0.0.0 or image name, add those images to the same network.
### How to Resolve Port Conflicts?
Docker-compose port format: `mapped_port:running_port`.
In bridge mode, container running ports don't conflict, but mapped ports can. Change the mapped port to a different value.
If `container1` needs to connect to `container2`, use `container2:running_port`.
(Brush up on Docker basics as needed)
### relation "modeldata" does not exist
PG database not connected or initialization failed — check logs. FastGPT initializes tables on each PG connection. Errors will appear in the logs.
1. Check if the database container started normally
2. For non-Docker deployments, manually install the pg vector extension
3. Check fastgpt logs for related errors
### Illegal instruction
Possible causes:
1. ARM architecture — use the official Mongo image: mongo:5.0.18
2. CPU doesn't support AVX — switch to mongo4.x. Change the mongo image to: mongo:4.4.29
### Operation `auth_codes.findOne()` buffering timed out after 10000ms
Mongo connection failed — check mongo's running status and **logs**.
Possible causes:
1. Mongo service didn't start (some CPUs don't support AVX — switch to mongo4.x, find the latest 4.x on Docker Hub, update the image version, and rerun)
2. Database connection environment variables are wrong (username/password, check host and port — for non-container network connections, use public IP and add directConnection=true)
3. Replica set startup failed, causing the container to keep restarting
4. `Illegal instruction.... Waiting for MongoDB to start`: CPU doesn't support AVX — switch to mongo4.x
### First Deployment: Root User Shows Unregistered
Logs will show error messages. Most likely Mongo replica set mode wasn't started.
### Can't Export Knowledge Base / Can't Use Voice Input or Playback
SSL certificate not configured — some features require it.
### Login Shows Network Error
Caused by service initialization errors triggering a restart.
- 90% of cases: incorrect config file causing JSON parsing errors
- The rest: usually because the vector database can't connect
### How to Change Password
Modify `DEFAULT_ROOT_PSW` in `docker-compose.yml` and restart — the password auto-updates.
### Deploy Zilliz Version: Get Account and Credentials
Open [Zilliz Cloud](https://zilliz.com.cn/), create an instance, and get the credentials.
![zilliz_key](/imgs/zilliz_key.png)
<Alert icon="🤖" context="success">
1. Set `MILVUS_ADDRESS` and `MILVUS_TOKEN` to match Zilliz's `Public Endpoint` and `Api key`. Remember to add your IP to the whitelist.
</Alert>
@@ -0,0 +1,405 @@
---
title: Docker-compose 部署
description: 使用 Docker Compose 快速部署 FastGPT
---
import { Alert } from '@/components/docs/Alert';
## 前置知识
1. 基础的网络知识:端口,防火墙……
2. Docker 和 Docker Compose 基础知识
## 部署架构图
![](/imgs/sealos-fastgpt.webp)
<Alert icon="🤖" context="success">
- MongoDB:用于存储除了向量外的各类数据
- PostgreSQL/Milvus/Oceanbase/SeekDB:存储向量数据
- AIProxy: 聚合各类 AI API,支持多模型调用 (任何模型问题,先自行通过 OneAPI 测试校验)
</Alert>
## 推荐配置
### PgVector版本
非常轻量,适合知识库索引量在 5000 万以下。
| 环境 | 最低配置(单节点) | 推荐配置 |
| -------------------------------- | ------------------ | ------------ |
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
### Milvus版本
对于亿级以上向量性能更优秀。
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
| 环境 | 最低配置(单节点) | 推荐配置 |
| ----------- | ------------------ | -------- |
| 测试 | 2c8g | 4c16g |
| 100w 组向量 | 未测试 | |
| 500w 组向量 | | |
### zilliz cloud版本
Zilliz Cloud 由 Milvus 原厂打造,是全托管的 SaaS 向量数据库服务,性能优于 Milvus 并提供 SLA,点击使用 [Zilliz Cloud](https://zilliz.com.cn/)。
由于向量库使用了 Cloud,无需占用本地资源,无需太关注。
### SeekDB版本
SeekDB 是基于 MySQL 协议的高性能向量数据库,与 OceanBase 协议完全兼容,支持高效的向量检索。
| 环境 | 最低配置(单节点) | 推荐配置 |
| -------------------------------- | ------------------ | ------------ |
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
<Alert icon="🤖" context="success">
SeekDB 使用 MySQL 协议,与 OceanBase 完全兼容:
- 支持 1536 维向量检索
- 内置 HNSW 索引算法
- 提供批量插入和查询优化
- 自动重试和连接池管理
</Alert>
## 前置工作
### 准备 Docker-compose 环境
<Tabs items={['Linux','MacOS','Windows']}>
<Tab value="Linux">
```bash
# 安装 Docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
systemctl enable --now docker
# 安装 docker-compose
curl -L https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# 验证安装
docker -v
docker-compose -v
# 如失效,自行百度~
```
</Tab>
<Tab value="MacOS">
推荐直接使用 [Orbstack](https://orbstack.dev/)。可直接通过 Homebrew 来安装:
```bash
brew install orbstack
```
或者直接[下载安装包](https://orbstack.dev/download)进行安装。
</Tab>
<Tab value="Windows">
我们建议将源代码和其他数据绑定到 Linux 容器中时,将其存储在 Linux 文件系统中,而不是 Windows 文件系统中。
可以选择直接[使用 WSL 2 后端在 Windows 中安装 Docker Desktop](https://docs.docker.com/desktop/wsl/)。
也可以直接[在 WSL 2 中安装命令行版本的 Docker](https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop)。
</Tab>
</Tabs>
## 开始部署
### 1. 获取配置文件
#### 方法一:使用交互式脚本部署
需要在 Linux/MacOS/Windows WSL 环境下执行,引导用户选择部署环境、向量库版本,IP地址等。
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh)
```
#### 方法二:手动下载部署
如果部署环境为非 *nix 环境或无法访问外网,需要手动下载 `docker-compose.yml` 进行部署
1. 下载 `docker-compose.yml` 文件:
<details>
<summary>点击展开查看不同数据库的 docker-compose 配置文件下载地址</summary>
- **Pgvector**
- 中国大陆地区镜像源(阿里云)[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.pg.yml)
- 全球镜像源(dockerhub, ghcr)[docker-compose.pg.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.pg.yml)
- **Oceanbase**
- 中国大陆地区镜像源(阿里云)[docker-compose.ob.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.ob.yml)
- 全球镜像源(dockerhub, ghcr)[docker-compose.ob.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.ob.yml)
- **Milvus**
- 中国大陆地区镜像源(阿里云)[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.milvus.yml)
- 全球镜像源(dockerhub, ghcr)[docker-compose.milvus.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.milvus.yml)
- **Zilliz**
- 中国大陆地区镜像源(阿里云)[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.zilliz.yml)
- 全球镜像源(dockerhub, ghcr)[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.zilliz.yml)
- **SeekDB**
- 中国大陆地区镜像源(阿里云)[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.seekdb.yml)
- 全球镜像源(dockerhub, ghcr)[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.seekdb.yml)
2. 下载 `config.json` 文件:
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
</details>
下载 config.json 文件
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
### 2. 修改环境变量
对于 `Zilliz 版本` 还需要获取密钥,参考 [部署 Zilliz 版本获取账号和密钥](#部署-zilliz-版本获取账号和密钥), 其他版本可直接下一步。
### 3. 开放外网端口/配置域名
以下端口必须被访问到:
1. 3000 端口(FastGPT 主服务)
2. 9000 端口(S3 服务)
1. 3005 端口(FastGPT SSE MCP server 服务)
### 4. 启动容器
在 docker-compose.yml 同级目录下执行。请确保`docker-compose`版本最好在2.17以上,否则可能无法执行自动化命令。
```bash
# 启动容器
docker-compose up -d
```
### 5. 访问 FastGPT
可通过第二步开放的端口/域名访问 FastGPT。
登录用户名为 `root`,密码为`docker-compose.yml`环境变量里设置的 `DEFAULT_ROOT_PSW`。
每次重启容器,都会自动初始化 root 用户,密码为 `1234`(与环境变量中的`DEFAULT_ROOT_PSW`一致)。
### 6. 配置模型
- 首次登录FastGPT后,系统会提示未配置`语言模型`和`索引模型`,并自动跳转模型配置页面。系统必须至少有这两类模型才能正常使用。
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/self-host/config/model/ai-proxy)
- 目前已知可能问题:首次进入系统后,整个浏览器 tab 无法响应。此时需要删除该tab,重新打开一次即可。
### 7. 按需安装系统插件
从 V4.14.0 版本开始,fastgpt-plugin 镜像仅提供运行环境,不再预装系统插件,所有 FastGPT 系统需手动安装系统插件。
* 通过插件市场安装,默认会向公开的 FastGPT Marketplace 获取数据进行安装。
* 如果你的 FastGPT 无法访问插件市场,则可以手动访问[FastGPT 插件市场](https://marketplace.fastgpt.cn/),先下载 .pkg 文件,再通过文件导入的方式安装到系统里。
* 除了安装外,还可对工具进行排序、默认安装、标签管理等。
![alt text](/imgs/image-121.png)
## FAQ
### FastGPT 和 FastGPT-plugin 版本对应
| FastGPT-plugin 版本 | FastGPT 主服务 |
| ------------------- | ---------------- |
| 0.5.x | >= 4.14.6 |
| < 0.5.0 | < 4.14.6 |
### S3 无法正常连接
检查`STORAGE_EXTERNAL_ENDPOINT`变量,需设置成客户端和 FastGPT 服务均可访问的地址。
**重要:**
> 填入的地址不可为`127.0.0.1`或者`localhost`等本地回环地址,可填 Docker 部署时的宿主机本地IP,但是需要把宿主机固定为静态 IP;或者统一为一个固定域名;目的是为了避免对象存储签名 URL 时,签发与上传的 URL 不一致导致的 403 错误。
>
> 具体查看 [对象存储配置及常见问题](/docs/self-host/config/object-storage)
### 登录系统后,浏览器无法响应
无法点击任何内容,刷新也无效。此时需要删除该tab,重新打开一次即可。
### Mongo 副本集自动初始化失败
最新的 docker-compose 示例优化 Mongo 副本集初始化,实现了全自动。目前在 unbuntu20,22 centos7, wsl2, mac, window 均通过测试。仍无法正常启动,大部分是因为 cpu 不支持 AVX 指令集,可以切换 Mongo4.x 版本。
如果是由于,无法自动初始化副本集合,可以手动初始化副本集:
1. 终端中执行下面命令,创建mongo密钥:
```bash
openssl rand -base64 756 > ./mongodb.key
chmod 600 ./mongodb.key
# 修改密钥权限,部分系统是admin,部分是root
chown 999:root ./mongodb.key
```
2. 修改 docker-compose.yml,挂载密钥
```yml
mongo:
# image: mongo:5.0.18
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
container_name: mongo
ports:
- 27017:27017
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
# 默认的用户名和密码,只有首次允许有效
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
- ./mongodb.key:/data/mongodb.key
```
3. 重启服务
```bash
docker-compose down
docker-compose up -d
```
4. 进入容器执行副本集合初始化
```bash
# 查看 mongo 容器是否正常运行
docker ps
# 进入容器
docker exec -it mongo bash
# 连接数据库(这里要填Mongo的用户名和密码)
mongo -u myusername -p mypassword --authenticationDatabase admin
# 初始化副本集。如果需要外网访问,mongo:27017 。如果需要外网访问,需要增加Mongo连接参数:directConnection=true
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
# 检查状态。如果提示 rs0 状态,则代表运行成功
rs.status()
```
### 如何修改API地址和密钥
默认是写了OneAPi的连接地址和密钥,可以通过修改`docker-compose.yml`中,fastgpt容器的环境变量实现。
`OPENAI_BASE_URL`API 接口的地址,需要加/v1)
`CHAT_API_KEY`API 接口的凭证)。
修改完后重启:
```bash
docker-compose down
docker-compose up -d
```
### 如何更新版本?
1. 查看[更新文档](/docs/self-host/upgrading/upgrade-intruction),确认要升级的版本,避免跨版本升级。
2. 修改镜像 tag 到指定版本
3. 执行下面命令会自动拉取镜像:
```bash
docker-compose pull
docker-compose up -d
```
4. 执行初始化脚本(如果有)
### 如何自定义配置文件?
修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/self-host/config/json)。
### 如何检查自定义配置文件是否挂载
1. `docker logs fastgpt` 可以查看日志,在启动容器后,第一次请求网页,会进行配置文件读取,可以看看有没有读取成功以及有无错误日志。
2. `docker exec -it fastgpt sh` 进入 FastGPT 容器,可以通过`ls data`查看目录下是否成功挂载`config.json`文件。可通过`cat data/config.json`查看配置文件。
**可能不生效的原因**
1. 挂载目录不正确
2. 配置文件不正确,日志中会提示`invalid json`,配置文件需要是标准的 JSON 文件。
3. 修改后,没有`docker-compose down`再`docker-compose up -d`restart是不会重新挂载文件的。
### 如何检查环境变量是否正常加载
1. `docker exec -it fastgpt sh` 进入 FastGPT 容器。
2. 直接输入`env`命令查看所有环境变量。
### 为什么无法连接`本地模型`镜像
`docker-compose.yml`中使用了桥接的模式建立了`fastgpt`网络,如想通过0.0.0.0或镜像名访问其它镜像,需将其它镜像也加入到网络中。
### 端口冲突怎么解决?
docker-compose 端口定义为:`映射端口:运行端口`。
桥接模式下,容器运行端口不会有冲突,但是会有映射端口冲突,只需将映射端口修改成不同端口即可。
如果`容器1`需要连接`容器2`,使用`容器2:运行端口`来进行连接即可。
(自行补习 docker 基本知识)
### relation "modeldata" does not exist
PG 数据库没有连接上/初始化失败,可以查看日志。FastGPT 会在每次连接上 PG 时进行表初始化,如果报错会有对应日志。
1. 检查数据库容器是否正常启动
2. 非 docker 部署的,需要手动安装 pg vector 插件
3. 查看 fastgpt 日志,有没有相关报错
### Illegal instruction
可能原因:
1. arm架构。需要使用 Mongo 官方镜像: mongo:5.0.18
2. cpu 不支持 AVX,无法用 mongo5,需要换成 mongo4.x。把 mongo 的 image 换成: mongo:4.4.29
### Operation `auth_codes.findOne()` buffering timed out after 10000ms
mongo连接失败,查看mongo的运行状态**对应日志**。
可能原因:
1. mongo 服务有没有起来(有些 cpu 不支持 AVX,无法用 mongo5,需要换成 mongo4.x,可以docker hub找个最新的4.x,修改镜像版本,重新运行)
2. 连接数据库的环境变量填写错误(账号密码,注意host和port,非容器网络连接,需要用公网ip并加上 directConnection=true
3. 副本集启动失败。导致容器一直重启。
4. `Illegal instruction.... Waiting for MongoDB to start`: cpu 不支持 AVX,无法用 mongo5,需要换成 mongo4.x
### 首次部署,root用户提示未注册
日志会有错误提示。大概率是没有启动 Mongo 副本集模式。
### 无法导出知识库、无法使用语音输入/播报
没配置 SSL 证书,无权使用部分功能。
### 登录提示 Network Error
由于服务初始化错误,系统重启导致。
- 90%是由于配置文件写不对,导致 JSON 解析报错
- 剩下的基本是因为向量数据库连不上
### 如何修改密码
修改`docker-compose.yml`文件中`DEFAULT_ROOT_PSW`并重启即可,密码会自动更新。
### 部署 Zilliz 版本,获取账号和密钥
打开 [Zilliz Cloud](https://zilliz.com.cn/), 创建实例并获取相关秘钥。
![zilliz_key](/imgs/zilliz_key.png)
<Alert icon="🤖" context="success">
1. 修改`MILVUS_ADDRESS`和`MILVUS_TOKEN`链接参数,分别对应 `zilliz` 的 `Public Endpoint` 和 `Api key`,记得把自己ip加入白名单。
</Alert>
@@ -0,0 +1,187 @@
---
title: Deploy with Sealos
description: One-click FastGPT deployment using Sealos
---
import { Alert } from '@/components/docs/Alert';
## Deployment Architecture
![](/imgs/sealos-fastgpt.webp)
## Multi-Model Support
FastGPT uses the one-api project to manage model pools, supporting OpenAI, Azure, mainstream domestic models, and local models.
See: [Quick OneAPI Deployment on Sealos](/docs/self-host/config/model/one-api)
## One-Click Deployment
With Sealos, you don't need to purchase servers or domains. It supports high concurrency and dynamic scaling, and databases use KubeBlocks with far better I/O performance than simple Docker container deployments. Choose a region below based on your needs.
### Singapore Region
Singapore servers are overseas with direct access to OpenAI, but users in mainland China need a VPN. International pricing is slightly higher. Click below to deploy 👇
<a
href="https://template.cloud.sealos.io/deploy?templateName=fastgpt&uid=fnWRt09fZP"
rel="external"
target="_blank"
>
<img
src="https://cdn.jsdelivr.net/gh/labring-actions/templates@main/Deploy-on-Sealos.svg"
alt="Deploy on Sealos"
/>
</a>
### Beijing Region
The Beijing region is hosted by Volcano Engine. Users in mainland China get stable access, but it can't reach OpenAI or other overseas services. Pricing is about 1/4 of the Singapore region. Click below to deploy 👇
<a
href="https://bja.sealos.run/?openapp=system-template%3FtemplateName%3Dfastgpt&uid=fnWRt09fZP"
rel="external"
target="_blank"
>
<img
src="https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg"
alt="Deploy on Sealos"
/>
</a>
### 1. Start Deployment
Since databases need to be deployed, wait 24 minutes after deployment before accessing. The default uses minimal resources, so the first access may be slow.
Follow the prompts to enter `root_password` and the `openai`/`oneapi` address and key.
![](/imgs/sealos1.png)
After clicking deploy, you'll be redirected to the app management page. Click the details button on the right side of the `fastgpt` main app (named fastgpt-xxxx), as shown below.
![](/imgs/sealos-deploy1.jpg)
After clicking details, you'll see the FastGPT deployment management page. Click the link in the external access address to open the FastGPT service.
To bind a custom domain or modify deployment parameters, click **Change** in the top right and follow Sealos' instructions.
![](/imgs/sealos2.png)
### 2. Log In
Username: `root`
Password: the `root_password` you set during one-click deployment
### 3. Configure Models
### 4. Configure Models
You must configure at least one model set, or the system won't work properly.
[View model configuration tutorial](/docs/self-host/config/model/intro)
## Pricing
Sealos uses pay-as-you-go billing based on allocated CPU, memory, and disk. For specific pricing, open the **Cost Center** in the Sealos control panel.
## Using Sealos
### Overview
FastGPT Commercial Edition includes 2 apps (fastgpt, fastgpt-plus) and 2 databases. When using multiple API keys, install OneAPI (1 app and 1 database), totaling 3 apps and 3 databases.
![](/imgs/onSealos1.png)
Click details on the right to view each app's information.
### Modifying Config Files and Environment Variables
In Sealos, open **App Launchpad** to see deployed FastGPT apps, and open **Database** to see corresponding databases.
In **App Launchpad**, select FastGPT, click **Change**, and you'll see environment variables and config files.
![](/imgs/fastgptonsealos1.png)
<Alert icon="🤖" context="success">
On Sealos, FastGPT runs 1 service and 2 databases. When pausing or deleting, handle the databases together. (You can start them during the day and pause at night to save costs.)
</Alert>
### How to Update/Upgrade FastGPT
[Upgrade script documentation](/docs/self-host/upgrading/upgrade-intruction) — read the docs first to determine which version to upgrade to. Do not skip versions.
For example, if you're on version 4.5 and want to upgrade to 4.5.1: change the image version to v4.5.1, run the upgrade script, wait for completion, then continue upgrading. If the target version doesn't require initialization, skip it.
Upgrade steps:
1. Check the [update documentation](/docs/self-host/upgrading/upgrade-intruction) to confirm the target version — avoid skipping versions.
2. Open Sealos app management
3. There are 2 apps: fastgpt, fastgpt-pro
4. Click the 3 dots on the right side of the app, then **Change**. Or click details, then **Change** in the top right.
5. Modify the image version number
![](/imgs/onsealos2.png)
6. Click **Change/Restart** to automatically pull the latest image and update
7. Run the initialization script for the corresponding version (if applicable)
### How to Get the FastGPT Access Link
Open the corresponding app and click the external access address.
![](/imgs/onsealos3.png)
### Configure a Custom Domain
Click **Change** on the app -> **Custom Domain** -> enter domain -> configure domain CNAME -> confirm -> confirm change.
![](/imgs/onsealos4.png)
### How to Modify Config Files
Open Sealos app management -> find the app -> **Change** -> scroll down to advanced configuration where you'll find config files -> add new or click an existing config file to edit -> click confirm change in the top right.
![](/imgs/onsealos5.png)
[Config file reference](/docs/self-host/config/json)
### Modify Site Name and Favicon
Add these environment variables to the app:
```
SYSTEM_NAME=FastGPT
SYSTEM_DESCRIPTION=
SYSTEM_FAVICON=/favicon.ico
HOME_URL=/dashboard/agent
```
SYSTEM_FAVICON can be a URL.
![](/imgs/onsealos6.png)
### Mount a Logo
Currently, the browser logo can't be fully replaced — only SVG is supported. Full replacement will be available after visual customization is implemented.
Add a mounted file with path: `/app/projects/app/public/icon/logo.svg`, with the SVG content as the value.
![](/imgs/onsealos7.png)
![](/imgs/onsealos8.png)
### Commercial Edition Config File
```
{
"license": "",
"system": {
"title": "" // System name
}
}
```
### Using OneAPI
[See OneAPI usage guide](/docs/self-host/config/model/one-api/)
@@ -0,0 +1,187 @@
---
title: Sealos 部署
description: 使用 Sealos 一键部署 FastGPT
---
import { Alert } from '@/components/docs/Alert';
## 部署架构图
![](/imgs/sealos-fastgpt.webp)
## 多模型支持
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、Azure 、国内主流模型和本地模型等。
可参考:[Sealos 快速部署 OneAPI](/docs/self-host/config/model/one-api)
## 一键部署
使用 Sealos 服务,无需采购服务器、无需域名,支持高并发 & 动态伸缩,并且数据库应用采用 kubeblocks 的数据库,在 IO 性能方面,远超于简单的 Docker 容器部署。可以根据需求,再下面两个区域选择部署。
### 新加坡区
新加披区的服务器在国外,可以直接访问 OpenAI,但国内用户需要梯子才可以正常访问新加坡区。国际区价格稍贵,点击下面按键即可部署👇
<a
href="https://template.cloud.sealos.io/deploy?templateName=fastgpt&uid=fnWRt09fZP"
rel="external"
target="_blank"
>
<img
src="https://cdn.jsdelivr.net/gh/labring-actions/templates@main/Deploy-on-Sealos.svg"
alt="Deploy on Sealos"
/>
</a>
### 北京区
北京区服务提供商为火山云,国内用户可以稳定访问,但无法访问 OpenAI 等境外服务,价格约为新加坡区的 1/4。点击下面按键即可部署👇
<a
href="https://bja.sealos.run/?openapp=system-template%3FtemplateName%3Dfastgpt&uid=fnWRt09fZP"
rel="external"
target="_blank"
>
<img
src="https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg"
alt="Deploy on Sealos"
/>
</a>
### 1. 开始部署
由于需要部署数据库,部署完后需要等待 2~4 分钟才能正常访问。默认用了最低配置,首次访问时会有些慢。
根据提示,输入`root_password`,和 `openai`/`oneapi` 的地址和密钥。
![](/imgs/sealos1.png)
点击部署后,会跳转到应用管理页面。可以点击`fastgpt`主应用右侧的详情按键(名字为 fastgpt-xxxx), 如下图所示。
![](/imgs/sealos-deploy1.jpg)
点击详情后,会跳转到 fastgpt 的部署管理页面,点击外网访问地址中的链接,即可打开 fastgpt 服务。
如需绑定自定义域名、修改部署参数,可以点击右上角变更,根据 sealos 的指引完成。
![](/imgs/sealos2.png)
### 2. 登录
用户名:`root`
密码是刚刚一键部署时设置的`root_password`
### 3. 配置模型
### 4. 配置模型
务必先配置至少一组模型,否则系统无法正常使用。
[点击查看模型配置教程](/docs/self-host/config/model/intro)
## 收费
Sealos 采用按量计费的方式,也就是申请了多少 cpu、内存、磁盘,就按该申请量进行计费。具体的计费标准,可以打开`sealos`控制面板中的`费用中心`进行查看。
## Sealos 使用
### 简介
FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据库,使用多 Api Key 时候需要安装 OneAPI(一个应用和一个数据库),总计3个应用和3个数据库。
![](/imgs/onSealos1.png)
点击右侧的详情,可以查看对应应用的详细信息。
### 修改配置文件和环境变量
在 Sealos 中,你可以打开`应用管理`App Launchpad)看到部署的 FastGPT,可以打开`数据库`(Database)看到对应的数据库。
在`应用管理`中,选中 FastGPT,点击变更,可以看到对应的环境变量和配置文件。
![](/imgs/fastgptonsealos1.png)
<Alert icon="🤖" context="success">
在 Sealos 上,FastGPT 一共运行了 1 个服务和 2
个数据库,如暂停和删除请注意数据库一同操作。(你可以白天启动,晚上暂停它们,省钱大法)
</Alert>
### 如何更新/升级 FastGPT
[升级脚本文档](/docs/self-host/upgrading/upgrade-intruction)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
升级步骤:
1. 查看[更新文档](/docs/self-host/upgrading/upgrade-intruction),确认要升级的版本,避免跨版本升级。
2. 打开 sealos 的应用管理
3. 有2个应用 fastgpt fastgpt-pro
4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。
5. 修改镜像的版本号
![](/imgs/onsealos2.png)
6. 点击变更/重启,会自动拉取最新镜像进行更新
7. 执行对应版本的初始化脚本(如果有)
### 如何获取 FastGPT 访问链接
打开对应的应用,点击外网访问地址。
![](/imgs/onsealos3.png)
### 配置自定义域名
点击对应应用的变更->点击自定义域名->填写域名-> 操作域名 Cname -> 确认 -> 确认变。
![](/imgs/onsealos4.png)
### 如何修改配置文件
打开 Sealos 的应用管理 -> 找到对应的应用 -> 变更 -> 往下拉到高级配置,里面有个配置文件 -> 新增或点击对应的配置文件可以进行编辑 -> 点击右上角确认变。
![](/imgs/onsealos5.png)
[配置文件参考](/docs/self-host/config/json)
### 修改站点名称以及 favicon
修改应用的环境变量,增加
```
SYSTEM_NAME=FastGPT
SYSTEM_DESCRIPTION=
SYSTEM_FAVICON=/favicon.ico
HOME_URL=/dashboard/agent
```
SYSTEM_FAVICON 可以是一个网络地址
![](/imgs/onsealos6.png)
### 挂载logo
目前暂时无法 把浏览器上的logo替换。仅支持svg,待后续可视化做了后可以全部替换。
新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg ,值为 svg 对应的值。
![](/imgs/onsealos7.png)
![](/imgs/onsealos8.png)
### 商业版镜像配置文件
```
{
"license": "",
"system": {
"title": "" // 系统名称
}
}
```
### One API 使用
[参考 OneAPI 使用步骤](/docs/self-host/config/model/one-api/)