> ## Documentation Index
> Fetch the complete documentation index at: https://enterprise-docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Qdrant 单节点

## 要求

* 已安装 Docker
  * [安装 Docker](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
  * [以非 root 用户身份管理 Docker](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
* 在虚拟机上开放 6333 端口

## 安装

### `QDRANT__SERVICE__API_KEY` 是必需的环境变量

你可以使用以下命令生成一个随机的 32 字节十六进制字符串：

```bash theme={null}
openssl rand -hex 32
```

复制并粘贴生成的字符串，替换 `docker-compose.yml` 文件中的 `#REPLACE_ME#`。

### 创建 `docker-compose.yml` 文件，并替换 `#REPLACE_ME#`

```bash theme={null}
version: "3.8"
services:
  qdrant:
    image: langgenius/qdrant:v1.7.3
    network_mode: "host"
    restart: always
    volumes:
      - /data/qdrant/data/:/qdrant/storage
    environment:
      QDRANT__SERVICE__API_KEY: #REPLACE_ME#
```

### 启动 qdrant 服务

```bash theme={null}
docker-compose up -d
```
