Appwrite Functions are mini-applications in Appwrite with their own endpoints. Each function can have many deployments, which can be thought of as versions of the mini-application.

Functions can be created and deployed in different ways to meet your unique development habits. You can automatically deploy Appwrite Functions from source control, build your own deployment pipelines using the Appwrite CLI, or upload code files manually. Here's everything you need to know to deploy your first Appwrite Function.


The recommended way to manage your Appwrite Function deployments is to use a version control system, like Git. This offers simple versioning and collaboration that will easily fit into the rest of your development workflow.

Create project screen

Create project screen

Create function

Before deploying your function with Git, create a new function attached to your Git repo.

  1. Navigate to Functions from the side bar of the Appwrite Console.

  2. Click Create function.

  3. When asked to Choose your source, under Connect Git repository, select your provider.

  4. Search for the Git repository that holds your function and click connect.

  5. Select a production branch. New commits pushed to the production branch will be automatically activated. Commits to any other branch will still be deployed, but not be activated.

  6. Input the root directory of the function inside the repository.

  7. If you don't want deploy comments to be made on your pull requests or commits, select Silent mode.

  8. Name your function, select a runtime that matches your function, and enter entrypoint.

  9. If you have build steps, like installing dependencies, input the commands into the Build settings heading's Command field. For example, npm install && npm build.

  10. Finally, configure the execute permissions of the function.


  1. Using Git, checkout the branch you configured as the production branch when creating the Appwrite Function.

  2. Create a new commit.

  3. Push your new commit.

  4. A new deployment will be automatically created, built and activated.


CLI setup

Before you can deploy with the Appwrite CLI, make sure you've installed and initialized the CLI.

To deploy with the Appwrite CLI, your function must be added to appwrite.json. Use the appwrite init function method to create a starter function, then paste in your function code.

appwrite init function

Edit the generated code, add dependencies, and deploy the function using the following command:

appwrite deploy function

Overwrite warning

If you made changes in the Appwrite Console that are different from your appwrite.json, using the CLI deploy command will overwrite your console changes. Update your appwrite.json manually before deploying.

Manual Deployment

You can upload your functions to be deployed using the Appwrite Console. The example below shows a simple Node.js function.

├── package.json
└── index.js

First, navigate inside the folder that contains your dependency file. Package your code files into the .tar.gz format:

tar --exclude code.tar.gz -czf code.tar.gz .

Next, navigate to your Appwrite Console and upload the function.

  1. Navigate to the function you want to deploy.

  2. Click Create deployment.

  3. Select the Manual tab.

  4. Input the entry point of your function under Entrypoint. For the example above, it would be index.js.

  5. Upload code.tar.gz.

  6. Select Activate deployment after build.

  7. Click Create.


Each deployed function can have its own domain. By default, one is generated for each of your functions.

To find or add a domain:

  1. Navigate to the Appwrite Console's Functions page.

  2. Navigate to the Domains tab.

  3. Click on Create domain.

  4. Input your domain and click Next.

  5. Copy the CNAME record and add it to your domain registrar.

  6. Click Go to console and wait for verification and certificate generation.

DNS records can take up to 48 hours to propagate.

Debugging Build

After deploying a function, you can find the status and build logs in the Appwrite Console.

  1. Navigate to Functions.

  2. Open the function you wish to inspect.

  3. Under the Deployments tab, find the status of the current and previous deployments.

  4. Access build logs by clicking the Build logs button.

Redeploy Builds

After updating the configuration, redeploy your function for changes to take effect. You can also redeploy to retry failed builds.

  1. Navigate to Functions.

  2. Open the function you wish to inspect.

  3. Under the Deployments tab, find the status of the current active deployment.

  4. Redeploy by clicking the triple-dots beside an execution, and hitting the Redeploy button.

Redeployment behavior varies depending on how the initial deployment was created.