Docs
Skip to content

Functions

Deployments_

Efficiently deploy your serverless functions with Appwrite. Explore deployment options, strategies, and best practices for seamless function execution.

3 min read

Raw

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.

Deployment status

Throughout the life cycle of a deployment, it could have the following status.

Statusdescription
activeThe deployment is built and currently activated and ready to be executed. A function can have one active deployment and deployment a must be active before being executed.
readyA deployment is built, but is not activated. ready deployments can be activated to replace the current active deployment.
buildingA deployment is being built. Check the build log for more detailed logs.
processingThe function deployment has begun and has not finished.
waitingThe deployment is queued but has not been picked up for processing.
failedA deployment was not successful. Check the build log for detailed logs for debugging.

Update deployment

Some Function settings require redeploying your function to be reflected in your active deployment. When you update a function by changing it's Git settings, Build settings, and Environment variables, you need to redeploy your function before they take effect.

Build logs

When you build a deployment, the logs generated will be saved for debugging purposes. You can find build logs by navigating to the deployments tab of your function, clicking the three-dots menu beside, and click Logs.

Redeploy

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.

Deployment retention

Deployment retention controls how long Appwrite keeps non-active function deployments. The active deployment is always kept. When a non-active deployment is older than the configured retention period, Appwrite automatically deletes it during maintenance. Set the value to 0 to keep non-active deployments forever.

To configure deployment retention from the Appwrite Console:

  1. Navigate to Functions.
  2. Open the function you want to configure.
  3. Go to Settings > Deployment retention.
  4. Turn on Keep deployments forever, or turn it off and choose how long to keep non-active deployments.
  5. Click Update.

Function deployment retention settings
Function deployment retention settings

The Console provides common presets from 1 Week to 10 Years. When using the API or a Server SDK, set deploymentRetention to the number of days to keep non-active deployments. The value must be between 0 and 36500, where 0 means unlimited retention.

When updating a function with a Server SDK, pass the existing settings you do not intend to change and update only deploymentRetention.

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.