> ## 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.

# 6. 安装后任务

> 创建管理员，验证编译和数据持久化，并让 Mac 上的本地 Ayakaleaf Pro 实例保持运行。

### 创建管理员和第一个项目

打开 [http://localhost:8080/launchpad](http://localhost:8080/launchpad)，创建第一个管理员账户并登录。然后按照 Linux 指南的 [6. 安装后任务](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/linux/6.-post-installation-tasks.md) 操作，并在其示例 URL 中使用端口 `8080`。

### 验证编译

登录页面能够打开，并不能证明独立的编译器容器及其数据挂载正常工作。请创建一个空白项目并编译以下 `main.tex`：

```latex theme={null}
\documentclass{article}
\begin{document}
Ayakaleaf Pro on macOS.
\end{document}
```

PDF 预览中应显示该文本。如有需要，请在项目设置中选择 TeX Live 2026。

对于包含中文文本的项目，请选择 **XeLaTeX** 作为编译器并测试：

```latex theme={null}
\documentclass{ctexart}
\begin{document}
你好，Ayakaleaf Pro。
\end{document}
```

### 验证数据持久化

```bash theme={null}
bin/stop
bin/start
```

重新打开该项目并再次编译。你的账户、源文件和项目文件应该都还在。使用默认路径时，实时数据位于 Mac 上 Toolkit 的 `data/` 目录中。

### 保持实例可用

当 Mac 进入睡眠时，macOS 会挂起 Docker Desktop 的虚拟机及其中的所有容器：没有人能打开该实例，正在运行的编译也会暂停，直到 Mac 唤醒。只有系统睡眠会产生影响，显示器关闭则没有关系。

如果有其他人使用该实例，或者你需要运行耗时较长的任务，请让 Mac 保持接通电源并阻止自动睡眠，请参阅[设置 Mac 的睡眠和唤醒设置](https://support.apple.com/guide/mac-help/set-sleep-and-wake-settings-mchle41a6ccd/mac)：

| Mac | 设置 |
| - | - |
| 台式 Mac（Mac mini、iMac、Mac Studio、Mac Pro） | **System Settings → Energy**（系统设置 → 能源）：开启 **Prevent automatic sleeping when the display is off** |
| MacBook | **System Settings → Battery → Options**（系统设置 → 电池 → 选项）：开启 **Prevent automatic sleeping on power adapter when the display is off**。该设置仅在连接电源适配器时生效，合上盖子仍会让 MacBook 进入睡眠 |

如果只想让 Mac 暂时保持唤醒，可以改为在终端窗口中运行 `caffeinate -i`。它会阻止空闲睡眠，直到你按下 `Ctrl+C` 或关闭该窗口。

Docker Desktop 是运行在你用户会话中的应用。要在重启后恢复实例，请在 Docker Desktop 的 **Settings → General** 中开启 **Start Docker Desktop when you sign in to your computer**。Toolkit 的容器使用 `restart: always`，因此 Docker Desktop 运行后，Docker 会自动重新启动它们，无需运行 `bin/up`。重启后，在有人登录这台 Mac 之前，实例将保持停止状态。

> [!NOTE]
>
> 保持唤醒的 Mac 会消耗更多电量。对于必须始终可访问的服务，我们推荐使用 Linux 服务器，请参阅 [Linux](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/linux)。

### 日常使用

在管理实例之前，请先打开 Docker Desktop。在新终端中运行：

```bash theme={null}
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH"
cd "$HOME/ayakaleaf-toolkit"
```

| 任务 | 命令 |
| - | - |
| 启动已有的容器 | `bin/start` |
| 停止容器并保留数据 | `bin/stop` |
| 应用配置更改 | `bin/up -d` |
| 查看状态 | `bin/docker-compose ps` |
| 查看启动日志 | `bin/docker-compose logs --tail=100 sharelatex` |
| 查看编译器日志 | `bin/logs -f clsi` |

`bin/start` 不会应用 `config/` 中的更改：编辑配置后请运行 `bin/up -d`。请保留 `config/` 和 `data/`，并在升级或迁移安装之前按照[数据和备份](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/maintenance/data-and-backups)操作。在 MongoDB 写入数据库文件时复制这些文件，并不能得到一致的备份。

本地使用时，请让实例保持在 `127.0.0.1` 上。如需为其他计算机提供服务，请有意识地设置监听地址、站点 URL 和 HTTPS，请参阅 Linux 指南的 [5. 个性化你的实例](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/linux/5.-personalizing-your-instance.md)。

如果遇到问题，请参阅[故障排除](https://ayakaleaf-pro.mintlify.site/zh-CN/on-premises/installation/using-docker-compose/macos/troubleshooting.md)。


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