Configuration

AFFiNE application settings can be managed from the Admin Panel or from config/config.json.

The official Docker Compose deployment mounts ./config into the AFFiNE container. Create config/config.json next to docker-compose.yml:

{
  "$schema": "https://github.com/toeverything/affine/releases/latest/download/config.schema.json",
  "server": {
    "name": "AFFiNE Self-hosted",
    "externalUrl": "http://localhost:3010"
  },
  "copilot": {
    "enabled": true,
    "byok": {
      "enabled": true
    }
  }
}

The schema URL enables field documentation and validation in editors that support JSON Schema.

  • server.name is the name shown for this AFFiNE server.

  • server.externalUrl must be the final URL users open. Use the public HTTPS URL when AFFiNE is behind a reverse proxy.

  • copilot.enabled enables AFFiNE AI features.

  • copilot.byok.enabled lets workspace owners configure provider keys from Workspace Settings → Integrations → AI BYOK.

After editing the file, apply it by recreating the AFFiNE containers:

docker compose up -d

New official Compose deployments do not use .env for user configuration. Their data and config paths are relative to the deployment directory.

For a custom container deployment, mount the directory containing config.json at /root/.affine/config. Keep the file readable only by trusted administrators when it contains credentials such as SMTP settings.

Admin Panel

Open <your-affine-url>/admin/settings to view and edit supported server settings. Changes saved there take effect immediately.

Provider API keys are workspace settings, not server settings. Add and test them in Workspace Settings → Integrations → AI BYOK; see ​AI.