Flutter Backend

I highly recommend self-hosted BaaS Appwrite to handle your project’s backend stuffs.

How to create an Appwrite DO server?

Create an Appwrite DO droplet from the marketplace

Create “A” record for your custom domain pointing to the DO server

Launch the console from the DO panel and run the following command

docker compose exec appwrite ssl domain="api.myapp.com"

Set up SMTP

Launch the console from the DO panel and run the following commands

cd appwrite/
nano .env

Edit and save the .env

_APP_SMTP_HOST=smtp.sendgrid.net
_APP_SMTP_PORT=587
_APP_SMTP_SECURE=tls
_APP_SMTP_USERNAME=YOUR-SMTP-USERNAME
_APP_SMTP_PASSWORD=YOUR-SMTP-PASSWORD
_APP_SYSTEM_EMAIL_ADDRESS=YOUR-SENDER-EMAIL

Then run the following commands

docker compose up -d
docker compose exec appwrite vars

Connect to DO Space

Create a DO space and get following

End point URL
Access & Secret keys

Edit and save the .env

_APP_STORAGE_DEVICE=dopaces
_APP_STORAGE_DO_SPACES_BUCKET=YOUT_BUCKET
_APP_STORAGE_DO_SPACES_REGION=YOUR_REGION
_APP_STORAGE_DO_SPACES_SECRET=YOUR_ACCESS_SECRET
_APP_STORAGE_DO_SPACES_ACCESS_KEY=YOUR_ACCESS_KEY

Then run the following commands

docker compose up -d
docker compose exec appwrite vars

How to upgrade Appwrite on DO?

Launch the console from the DO panel and run the following command

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="upgrade" \
    appwrite/appwrite:1.4.3

Once the setup is completed, verify that you have the latest version of Appwrite.

docker ps | grep appwrite/appwrite

Then run the following commands

cd appwrite/
docker compose down && docker compose up -d 
docker compose exec appwrite migrate