--- title: "使用 Docker 部署 - Xiaozhi Client" description: "使用 Docker 或 Docker Compose 快速部署 xiaozhi-client 服务。" --- # 使用 Docker 部署 **前期准备**: 在开始之前,你至少需要有一个小智硬件设备,并已添加至小智官方服务端。并且已准备好 Docker 环境 ## 安装方式 ### 方式一:使用启动脚本(推荐) 如果你的网络环境无法访问 github ,可以使用 gitee 进行安装 ```bash # 下载脚本 curl -fsSL https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker/scripts/start.sh | bash ``` ```bash curl -fsSL https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker/scripts/start.sh | bash ``` ### 方式二:使用 Docker Compose ## 获取 docker-compose.yml ```bash curl -O https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker/docker-compose.yml ``` ```bash curl -O https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker/docker-compose.yml ``` ## 启动服务 ```bash docker-compose up -d ``` ### 方式三:手动启动 ## 创建挂载点目录 ```bash mkdir -p ~/xiaozhi-client ``` ## 拉取镜像并启动服务 ```bash docker run -d \ --name xiaozhi-client \ -p 9999:9999 \ -v ~/xiaozhi-client:/workspaces \ --restart unless-stopped \ shenjingnan/xiaozhi-client ``` ## 管理接入点 在启动容器服务之后,我们需要配置小智接入点,才可以正常使用 ## 打开管理界面 如果你的容器和你的本机在一起,可以直接使用浏览器打开网址:http://localhost:9999 如果你是在单独的设备部署容器,请确保你的电脑和单独的容器设备在同一个局域网,然后打开对应IP地址:http://\{容器IP\}:9999 ## 配置小智接入点 TODO ## 重启服务 TODO