Run AFFiNE with Custom Options
When you use the provided compose.yml
to run AFFiNE, docker compose will generate AFFiNE configuration files within the CONFIG_LOCATION
directory you specified in your .env
file 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 $CONFIG_LOCATION/.env
.
The environment variables utilized by AFFiNE are listed as follows:
Environment Variable Name | Description | Default Value |
---|---|---|
AFFINE_SERVER_HOST | Default access domain of AFFiNE. Make sure this matches the URL in browser. | localhost |
AFFINE_SERVER_PORT | Default access port of AFFiNE. Make sure this matches the URL in browser. | 3010 |
AFFINE_SERVER_HTTPS | Use https prefix in url. Make sure this matches the URL in browser. | false |
AFFINE_SERVER_EXTERNAL_URL | Used to factor url to server resources | (default to [protocol]://[host][:port] ) |
MAILER_HOST | Email server domain | |
MAILER_PORT | Email server port | |
MAILER_USER | Email login user | |
MAILER_PASSWORD | Email password | |
MAILER_SENDER | Email sender (not avaliable for consumer mail service like gmail/outlook) | |
DATABASE_URL | Postgres server Url | |
REDIS_SERVER_HOST | Redis server domain/ip | |
REDIS_SERVER_PORT | Redis server port | |
REDIS_SERVER_USER | Redis server user | |
REDIS_SERVER_PASSWORD | Redis server password | |
REDIS_SERVER_DATABASE | Redis server database (0-20 number only) | 0 |
Q&A
Why is the environment variable I set not taking effect?
The environment variable reading of AFFiNE has a specific priority. Please modify it through $CONFIG_LOCATION/.env
as a priority, as environment variables passed through the container may be ignored.
Why can’t emails be sent after configuring the email service?
Most personal email providers’ SMTP services require using a separate password different from your login password.
We cannot list configuration tutorials for all email providers, here are only some official setup tutorials for popular personal email providers:
Can i create user / invite user without mail service?
Here are some workarounds to avoid setting up the mail service, but their use is not officially supported. It is recommended to configure the mail service to experience the full functionality:
-
Create User
Go to
your-domain.com/admin/accounts
with your admin account, add a user, then clickmenu
->Reset Password
, you can get a reset link, send it to the person who needs to create a user -
Invite user into workspace
Accept invite in notification, avaliable after 0.21.0