Docs
Skip to content

Functions

Deploy manually_

Learn to deploy Appwrite functions manually from the Appwrite CLI or the Appwrite Console.

2 min read

Raw

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.

While we recommend you create deployments through automatic Git deployments, you can also create deployments manually or through the Appwrite CLI.

CLI

You can create functions using the CLI without needing to access the Console.

To deploy your function with the Appwrite CLI, use the appwrite init functions command to create a starter function and paste your code into the generated file and folder.

Bash
appwrite init functions

To deploy the generated code, add any dependencies and push the function using the following command:

Bash
appwrite push functions

Configure CLI deployments

If you need to target a different project, API endpoint, change the path or entry point of your function, or update any of the other configuration options, you can do so by editing the appwrite.config.json file.

For larger projects, you can split function definitions into a separate JSON file with multi-file CLI configuration.

Manual Deployment

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

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

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

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.

Debugging

  • If you updated your function's configuration but the deployment is not working as expected, you may need to first redeploy your function before the changes take effect.

  • If you notice your function is missing dependencies during build or at runtimes, update it's build settings. Navigate to Functions > your function > Settings > Configuration > Build settings. These commands will be ran before the function is built and can be used to install dependencies.

  • If you're missing some code files at build time, make sure they are included in the Root directory. Only files in the root directory folder will be copied to the executor.

Was this page helpful?

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