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

# 单独启动前端 Docker 容器

> 本文档由 AI 自动翻译。如有任何不准确之处，请参考 [英文原版](/en/self-host/deploy/advanced-deployments/start-the-frontend-docker-container)。

在单独开发后端时，你可能只需要从源代码启动后端服务，而无需在本地构建和启动前端。在这种情况下，你可以通过拉取 Docker 镜像并运行容器来直接启动前端服务。以下是具体步骤：

#### 从 DockerHub 拉取前端服务的 Docker 镜像：

```bash theme={null}
docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 langgenius/dify-web:latest
```

#### 从源代码构建 Docker 镜像

1. 构建前端镜像

   ```
   cd web && docker build . -t dify-web
   ```

2. 启动前端镜像

   ```
   docker run -it -p 3000:3000 -e CONSOLE_URL=http://127.0.0.1:5001 -e APP_URL=http://127.0.0.1:5001 dify-web
   ```

3. 当控制台域和 Web 应用域不同时，可以分别设置 CONSOLE\_URL 和 APP\_URL

4. 要在本地访问，可以访问 [http://127.0.0.1:3000](http://127.0.0.1:3000/)
