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

# 企業自部署

> 使用企業自部署授權在客戶自有基礎設施上部署 Alforse。

## 概览

企業自部署是面向持有 self\_hosted 商业方案和签名授權檔案的客戶執行时，不是内部工程執行方式。部署前应確認授權、基礎設施、金鑰管理、备份、檔案扫描、郵件和監控策略。

## 前提条件

* 签名授權檔案和 LICENSE\_PUBLIC\_KEY。
* 客戶自有容器平台或受控主机。
* 两个 PostgreSQL 資料庫：系统元資料与租户業務資料必须分离。
* Redis、S3 兼容對象存储、TLS 域名、郵件服務和檔案扫描服務。
* 首个租户管理員的開通流程和復原策略。

## 步骤

* Set `EDITION=self_hosted` and `NODE_ENV=production`.
* Configure `LICENSE_FILE` and `LICENSE_PUBLIC_KEY`.
* Run `docker compose -f docker-compose.self-hosted.yml up -d --build` from `apps/api`.
* Run `npm run prisma:generate`, `npm run prisma:migrate`, and `npm run db:seed`.
* Verify `GET /health` on the approved API origin.

## 运维检查

* 管理員 MFA 策略已生效。
* 密碼重置、邀請和备份验证码郵件可送达。
* 檔案下载遵守扫描策略。
* GET /health 已纳入監控。
* 資料庫备份和復原流程已演练。
