Self-host AFFiNE

Run AFFiNE with Custom Options

When you use the provided compose.yml to run AFFiNE, docker compose will generate AFFiNE configuration files within the ~/.affine/self-host/config directory on the host system after the initial startup.

If you want save the configuration file elsewhere, please modify compose.yml

To custom your service to your needs, you can adjust the environment variables located in ~/.affine/self-host/config/.env.

The environment variables utilized by AFFiNE are listed as follows:

Environment Variable NameDescriptionDefault Value
AFFINE_SERVER_HOSTDefault access domain of AFFiNE. Make sure this matches the URL in browser.localhost
AFFINE_SERVER_PORTDefault access port of AFFiNE. Make sure this matches the URL in browser.3010
AFFINE_SERVER_HTTPSUse https prefix in url.
Make sure this matches the URL in browser.
MAILER_HOSTEmail server domain
MAILER_PORTEmail server port
MAILER_USEREmail login user
DATABASE_URLPostgres server Url
REDIS_SERVER_HOSTRedis server domain/ip
REDIS_SERVER_PORTRedis server port
REDIS_SERVER_USERRedis server user
REDIS_SERVER_PASSWORDRedis server password
REDIS_SERVER_DATABASERedis server database (0-20 number only)0
MAILER_SENDEREmail sender (not avaliable for consumer mail service like gmail/outlook)