---
title: Deploy Appwrite with AI on Blossom
url: "/deploy/appwrite/"
canonical_url: https://blossom88.com/deploy/appwrite/
markdown_url: https://blossom88.com/deploy/appwrite.md
summary: Deploy Appwrite with AI on Blossom. Add authentication, database APIs, realtime
  updates and private R2 files to your app with managed PostgreSQL and Redis.
categories:
- deployment
- backend
stack:
- PHP
- Swoole
- TypeScript
- React
- PostgreSQL
- Redis
- ClickHouse
---

# Deploy Appwrite with AI on Blossom

[Appwrite](https://appwrite.io/) provides authentication, databases, file storage
and realtime APIs for web and mobile apps.

## Ask Your Agent

> **Ask your AI agent:** Deploy Appwrite on Blossom for my app's sign-in, database and private files.
>
> Follow this guide: https://blossom88.com/deploy/appwrite/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Your Backend Setup

| Part | Purpose |
|---|---|
| Gateway and Console | One HTTPS address and a private administration dashboard |
| API, workers and Realtime | Sign-in, records, file permissions and live updates |
| Managed PostgreSQL and Redis | Application data, sessions, queues and coordination |
| Private R2 bucket | Uploaded files shared across app Containers |
| ClickHouse Persistent Service | Usage data on its own Volume |

This uses the [BSD-licensed Appwrite server](https://github.com/appwrite/appwrite/blob/2.7.4/LICENSE).
Bring a private R2 bucket and a bucket-scoped key. This recipe covers Auth,
TablesDB, Storage and Realtime; Functions and Sites need a separate execution
layer.

![Appwrite displays private project files and an uploaded image preview.](/deploy/assets/images/appwrite/private-files.webp)

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

Your agent checks the current
[Appwrite self-hosting requirements](https://appwrite.io/docs/advanced/self-hosting)
and [supported topologies](https://appwrite.io/docs/advanced/self-hosting/configuration/topologies),
then chooses compatible maintained images and resources. Keep the configuration
with your App.

Use the combined worker and scheduler topology. Run the API, Console, worker,
Realtime, scheduler, maintenance, interval and image helpers on regular App
Capacity. Connect managed PostgreSQL and Redis through Environment links.
TablesDB uses PostgreSQL; leave DocumentsDB, VectorsDB and embeddings disabled
unless you also configure their dependencies.

Configure Appwrite's S3 storage driver for R2: its endpoint, bucket, region
`auto`, path-style access and scoped credentials. Keep Appwrite's encryption
keys stable across deployments. For temporary tests, prefer expiring
bucket-scoped credentials; a deployment you retain needs an appropriate
credential lifetime or renewal.

### Create the App and Data

Use the IDs returned by Blossom. Your agent prepares the YAML files with your
Location and the selected release's requirements.

    blossom profile:show
    blossom app:create --data '{"app":{"name":"appwrite"}}'
    blossom environment:create --data environment.yml
    blossom database_instance:create --data postgres.yml
    blossom cache_instance:create --data redis.yml
    blossom environment_link:create --data postgres-link.yml
    blossom environment_link:create --data redis-link.yml

Link the logical PostgreSQL Database as `DATABASE_URL` and the Redis Cache as
`REDIS_URL`. The startup configuration maps those links to Appwrite's database
and Redis settings. Keep both data endpoints private.

### Configure the Services

    blossom service:create --data gateway.yml
    blossom service:create --data console.yml
    blossom service:create --data api.yml
    blossom service:create --data worker.yml
    blossom service:create --data realtime.yml
    blossom service:create --data scheduler.yml
    blossom service:create --data maintenance.yml
    blossom service:create --data interval.yml
    blossom service:create --data autogravity.yml
    blossom service:create --data exiftool.yml
    blossom service:create --data usage.yml

Each service.yml selects its own image. Only the gateway is public: it sends
`/v1/realtime` to Realtime, other `/v1` requests to the API, and the remaining
requests to the Console. This keeps browser HTTP and WebSocket requests on one
origin. Save the gateway configuration in its startup files; encode multiline
configuration if you pass it through an environment variable.

The API's readiness check must wait for the release's schema initialization,
not just an open port. Fit process counts and queue concurrency to each
Container's allocation. Include the upstream numeric defaults required by the
Console, including storage limits and compute limits even when Functions and
Sites are disabled.

Give ClickHouse a
[Persistent Service](/docs/apps/persistent-services/) Volume at its
upstream data path and keep it at one Container. Other Services use R2 for
shared uploaded files and can rebuild local caches.

### Deploy and Protect Access

    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy --id environment-100 --follow
    blossom environment:show --id environment-100

After the gateway's HTTPS address is available, apply it consistently to the
Appwrite domain settings and Console endpoint. Lock Console registration to
your owner before exposing the API. Keep the Console behind Blossom Account
access; allow `/v1/*` through that gate so your app can use Appwrite's own
sessions, API keys and permissions.

    blossom environment:update --id environment-100 --data access.yml
    blossom environment:deploy --id environment-100 --follow

Configure an owned email provider before relying on invitations, verification
or password-reset emails. Keep privileged API keys on your backend.

</details>

## Connect Your App

Create a project, configure its allowed origins and use its public project ID
with the gateway's `/v1` endpoint. Enable row security and file security, then
give each user only the permissions they need.

<details class="optional-reading" markdown="1">
<summary>Updates and storage</summary>

Keep the managed data, R2 bucket, ClickHouse Volume and encryption keys when
updating the App. After replacing Containers, check a fresh login, saved rows,
private downloads and realtime delivery. Check another user's denied access too.
Our development check replaced all eleven Containers and repeated those
workflows with the same managed-data and ClickHouse Volumes.
ClickHouse remains a single writer; its replacement can briefly pause usage
storage.

</details>



## What You Get

- An Appwrite Console with Auth, TablesDB, Storage and Realtime APIs
- Private files in R2 with per-user permissions
- Managed PostgreSQL and Redis, with saved data kept across app updates
