> ## 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-TW/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 是在您使用者工作階段中執行的 App。若要在重新開機後讓執行個體恢復運作，請在 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-TW/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-TW/on-premises/maintenance/data-and-backups)操作。在 MongoDB 寫入資料庫檔案時複製這些檔案，並不是一致的備份。

本機使用時，請讓執行個體維持在 `127.0.0.1`。若要提供給其他電腦使用，請刻意設定監聽位址、網站 URL 與 HTTPS，請參閱 Linux 指南的 [5. 個人化您的執行個體](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/installation/using-docker-compose/linux/5.-personalizing-your-instance.md)。

若有任何問題，請參閱[疑難排解](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/installation/using-docker-compose/macos/troubleshooting.md)。


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