---
layout: article
title: Terraform provider
description: Manage Appwrite infrastructure as code with the official Terraform provider. Works with Appwrite Cloud and Community Edition.
---

The [Terraform provider for Appwrite](https://github.com/appwrite/terraform-provider-appwrite) lets you declare Appwrite resources in `.tf` files and apply them through [HashiCorp Terraform](https://www.terraform.io/). It covers TablesDB (databases, tables, columns, indexes, rows), dedicated databases (PostgreSQL, MySQL, and MongoDB), DocumentsDB, VectorsDB, Storage (buckets and files), Auth (users and teams), Functions, Sites, Messaging (providers, topics, subscribers), webhooks, backup policies, projects, and custom domains. It is the official way to automate Appwrite project configuration alongside the rest of your stack.

# Resources

Resource types use the `appwrite_` prefix and match the [Terraform Registry](https://registry.terraform.io/providers/appwrite/appwrite/latest/docs) documentation.

| Area | Resources |
|------|-----------|
| TablesDB | `appwrite_tablesdb`, `appwrite_tablesdb_table`, `appwrite_tablesdb_column`, `appwrite_tablesdb_index`, `appwrite_tablesdb_row` |
| Dedicated databases | `appwrite_postgresql_database`, `appwrite_mysql_database`, `appwrite_mongo_database`, and per engine `*_backup_policy`, `*_backup_storage`, `*_branch`, `*_pooler` (PostgreSQL and MySQL), `appwrite_postgresql_extension` |
| DocumentsDB | `appwrite_documentsdb`, `appwrite_documentsdb_collection`, `appwrite_documentsdb_index`, `appwrite_documentsdb_document` |
| VectorsDB | `appwrite_vectorsdb`, `appwrite_vectorsdb_collection`, `appwrite_vectorsdb_index`, `appwrite_vectorsdb_document` |
| Storage | `appwrite_storage_bucket`, `appwrite_storage_file` |
| Auth | `appwrite_auth_user`, `appwrite_auth_team` |
| Functions | `appwrite_function`, `appwrite_function_variable`, `appwrite_function_deployment` |
| Sites | `appwrite_site`, `appwrite_site_variable`, `appwrite_site_deployment` |
| Messaging | `appwrite_messaging_provider`, `appwrite_messaging_topic`, `appwrite_messaging_subscriber` |
| Webhooks | `appwrite_webhook` |
| Backups | `appwrite_backup_policy` |
| Custom domains | `appwrite_proxy_rule` |

# Data sources

Data sources read resources that already exist instead of creating them. Use them to reference identifiers or attributes from resources created outside Terraform or in another state.

| Name | Description |
|------|-------------|
| `appwrite_tablesdb` | Look up a database by ID |
| `appwrite_postgresql_database`, `appwrite_mysql_database`, `appwrite_mongo_database` | Look up a dedicated database by ID, including connection credentials |
| `appwrite_postgresql_databases`, `appwrite_mysql_databases`, `appwrite_mongo_databases` | List dedicated databases, with query filtering |
| `appwrite_postgresql_specifications`, `appwrite_mysql_specifications`, `appwrite_mongo_specifications` | List the compute specifications your plan allows |
| `appwrite_postgresql_database_status`, `appwrite_mysql_database_status`, `appwrite_mongo_database_status` | Read live health, replication, and storage |
| `appwrite_postgresql_backups`, `appwrite_mysql_backups`, `appwrite_mongo_backups` | List backups of a dedicated database |
| `appwrite_postgresql_extensions` | List installed and installable PostgreSQL extensions |
| `appwrite_documentsdb`, `appwrite_vectorsdb` | Look up a DocumentsDB or VectorsDB database by ID |
| `appwrite_documentsdb_specifications`, `appwrite_vectorsdb_specifications` | List the specifications each product allows |
| `appwrite_storage_bucket` | Look up a storage bucket by ID |
| `appwrite_auth_user` | Look up a user by ID |
| `appwrite_auth_team` | Look up a team by ID |
| `appwrite_function` | Look up a function by ID |
| `appwrite_site` | Look up a site by ID |
| `appwrite_messaging_topic` | Look up a messaging topic by ID |
| `appwrite_webhook` | Look up a webhook by ID |

**Looking for self-hosting?**

This section is about **Appwrite resources inside a project** (for example databases and tables) using Terraform. If you want to install or operate the Appwrite server itself (Docker, configuration, TLS, scaling), go to the [self-hosting documentation](/docs/advanced/self-hosting) instead.

# What is Terraform?

[Terraform](https://www.terraform.io/) is an infrastructure-as-code tool. You write **configuration** in a declarative language (HCL) that describes what should exist; Terraform figures out **how** to create or update it.

If you are new to the idea:

- **Provider**: A plugin that teaches Terraform how to talk to a specific API (here, Appwrite).
- **Resource**: Something Terraform should create and manage (for example an Appwrite database or table).
- **State**: Terraform remembers what it already created so the next run can update or destroy only what changed.
- **Plan / apply**: You run `terraform plan` to preview changes, then `terraform apply` to execute them.

You still use the [Appwrite Console](https://cloud.appwrite.io) and SDKs for day-to-day app development; the provider is for **repeatable, version-controlled** setup of project resources across environments.

# Official repository and registry

Source code, issues, and contribution guidelines:

- [GitHub](https://github.com/appwrite/terraform-provider-appwrite): `appwrite/terraform-provider-appwrite`: source and issues.
- [Terraform Registry](https://registry.terraform.io/providers/appwrite/appwrite/latest/docs): `appwrite/appwrite`: install, versions, generated schemas.

The provider works with **Appwrite Cloud** and **Community Edition** (self-hosted Appwrite). You point it at your API endpoint and authenticate with a project API key.

# Next steps

- [Configuration](/docs/tooling/terraform/provider): Install the provider, set endpoints, environment variables, and optional per-resource `project_id`.
- [TablesDB](/docs/tooling/terraform/resources/databases): TablesDB: databases, tables, columns, indexes, and rows.
- [Dedicated databases](/docs/tooling/terraform/resources/dedicated-databases): PostgreSQL, MySQL, and MongoDB on reserved infrastructure.
- [DocumentsDB](/docs/tooling/terraform/resources/documentsdb): Databases, collections, indexes, and JSON documents.
- [VectorsDB](/docs/tooling/terraform/resources/vectorsdb): Collections of embeddings searched by similarity.
- [Storage](/docs/tooling/terraform/resources/storage): Buckets and uploaded files.
- [Messaging](/docs/tooling/terraform/resources/messaging): Providers, topics, and subscribers.
- [Auth](/docs/tooling/terraform/resources/auth): Users and teams.
- [Functions](/docs/tooling/terraform/resources/functions): Functions and environment variables.
- [Sites](/docs/tooling/terraform/resources/sites): Sites and site variables.
- [Webhooks](/docs/tooling/terraform/resources/webhooks): Event delivery to your HTTP endpoints.
- [Backups](/docs/tooling/terraform/resources/backups): Backup policies where supported.
- [Custom domains](/docs/tooling/terraform/resources/domains): Proxy rules for sites and functions.
