> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 5. 个性化你的实例

> 设置端口、站点 URL 和 TeX Live 镜像，启用沙盒编译，并在 WSL 2 上启动 Ayakaleaf Pro。

请在 **Ubuntu** 中，从 `~/ayakaleaf-toolkit` 目录运行命令和编辑文件。

**1. 容器设置**

在 `config/overleaf.rc` 中编辑以下已有条目：

```bash title="config/overleaf.rc" theme={null}
PROJECT_NAME=ayakaleaf-wsl
SERVER_PRO=true
OVERLEAF_LISTEN_IP=127.0.0.1
OVERLEAF_PORT=8080
SIBLING_CONTAINERS_ENABLED=true
DOCKER_SOCKET_PATH=/var/run/docker.sock
```

保留默认的数据路径以及内置的 MongoDB 和 Redis 服务。端口 `8080` 供本地 Windows 浏览器使用；绑定到 `127.0.0.1` 可使其仅限本地访问。沙盒编译会为每次编译使用一个单独的 Linux 容器，而不是在应用程序容器内运行 TeX。Docker socket 使应用程序能够创建这些容器，而 Toolkit 会为 `data/overleaf/data/compiles` 下的编译数据提供主机路径。

**2. 应用程序设置**

在 `config/variables.env` 中设置以下值，替换任何同名的已启用条目：

```dotenv title="config/variables.env" theme={null}
OVERLEAF_SITE_URL=http://localhost:8080
TEX_LIVE_DOCKER_IMAGE=ghcr.io/ayaka-notes/texlive-full:2026.1
ALL_TEX_LIVE_DOCKER_IMAGES=ghcr.io/ayaka-notes/texlive-full:2026.1
ALL_TEX_LIVE_DOCKER_IMAGE_NAMES="TeX Live 2026"
```

完整镜像包含适用于各类项目的宏包和字体。请为它和应用程序预留至少 40 GB 的可用存储空间，另外还需要存放项目数据和未来更新的空间。

如果只是快速进行部署测试，可以改用更小的 **basic** 镜像。它足以完成第 6 步中的简单 article 测试，但不包含完整的宏包和字体集：

```dotenv theme={null}
TEX_LIVE_DOCKER_IMAGE=ghcr.io/ayaka-notes/texlive-basic:2026.1
ALL_TEX_LIVE_DOCKER_IMAGES=ghcr.io/ayaka-notes/texlive-basic:2026.1
ALL_TEX_LIVE_DOCKER_IMAGE_NAMES="TeX Live 2026 Basic"
```

请在这两组设置中选择一组，不要出现重复的已启用键。basic 镜像的 [Dockerfile](https://github.com/ayaka-notes/texlive-full/blob/main/texlive/2026/Dockerfile.basic) 包含 `latexmk`、XeTeX 和 `fontspec`，但不包含 `ctex` 或完整的字体集。在 basic 镜像中缺少某个 LaTeX 宏包本身并不表示沙盒有问题。

生成一个会话密钥：

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

将结果作为 `OVERLEAF_SESSION_SECRET` 添加到 `config/variables.env` 中。同时请保留已生成的邀请令牌密钥。对于不使用邮件的本地实例，请不要设置 SMTP 相关设置和 `OVERLEAF_EMAIL_FROM_ADDRESS`。

**3. 启动你的实例**

```bash theme={null}
bin/up -d
```

Toolkit 会启动 MongoDB、初始化其副本集、下载所选的 TeX Live 镜像，然后启动 Redis 和应用程序。在下载大型镜像时，它看起来可能会暂停。在第一个 `bin/up` 仍在运行时，不要再运行第二个 `bin/up`。

在另一个 Ubuntu 终端中检查：

```bash theme={null}
cd "$HOME/ayakaleaf-toolkit"
bin/docker-compose ps
bin/docker-compose logs --tail=100 mongo
bin/docker-compose logs --tail=100 -f sharelatex
```

按 `Ctrl+C` 停止跟踪日志；以分离模式运行的容器会继续运行。如果启动在 MongoDB 处失败，请在重试之前按照 [MongoDB 无法启动](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/windows/troubleshooting.md#mongodb-fails-to-start) 操作。不要通过删除其数据目录来重置现有安装。

检查端口和首次运行页面：

```bash theme={null}
bin/docker-compose port sharelatex 80
curl -I http://localhost:8080/launchpad
```

端口应为 `127.0.0.1:8080`。如果 HTTP 请求一开始失败，请等待应用程序完成初始化。

**4. 从 Windows 打开实例**

在你的 **Windows 浏览器**中打开 [http://localhost:8080/launchpad](http://localhost:8080/launchpad)。在 Windows 中也请使用这个地址，而不是临时的 WSL IP 地址。

要在浏览器之外单独检查 Windows 的 HTTP 访问，请在 **PowerShell** 中运行：

```powershell theme={null}
curl.exe -I http://localhost:8080/launchpad
```

如果 Ubuntu 可以访问该页面而 Windows 不能，请参阅 [Windows 无法打开 localhost](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/windows/troubleshooting.md#windows-cannot-open-localhost)。

### 下一步

请继续阅读 [6. 安装后任务](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/windows/6.-post-installation-tasks.md)，创建管理员并验证沙盒编译和数据持久化。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.