Docker Compose is the recommended method to self-host AFFiNE.
With Docker or other Docker compatible container service, you will be provided docker compose comand to run AFFiNE.
You can choose to download the latest compose file tagged together with AFFiNE releases.
or go to docker-compose.yml and copy the content, put it in manually created docker-compose.yml file in the folder created in Step 1.
A .env file is required to configure docker volumes mapping to specific where the user data will be persisted at and other required environment variables.
or go to .env and copy the content, put it in manually created .env file in the folder created in Step 1.
Then, you need to update the .env file to correct the fields to your configurations.
Most of the values in .env file shouldn't be changed once your host initialized and start to have data written.
If you do want to, for example, change the location of the affine folder, please check out Backup and Restore for help.
If everything goes perfect, you will be able to visit your AFFiNE in browser with http://localhost:3010. You might update the port to what you configured in .env file.
Read After Installation for things need to be done right after first time installation and Upgrade for instructions to upgrade your instances.