Skip to content
Back

Is there a way to deploy global variables using appwrite cli (not appwrite project create-variable)?

  • 0
  • 2
  • Self Hosted
  • General
Anton Androsov
26 Jan, 2026, 16:29

Hello! I wan't to deploy my global variables to my project using appwrite cli and my appwrite.config.json. Is there a method to do it using configuration files and cli?

My functions need to get access to global variables in appwrite, so, i need a way to deploy it automatically.

TL;DR
Global variables cannot be directly deployed using appwrite cli, but you can mount the variables you want to deploy by using the "--with-variables" option when pushing functions. This option reads the .env file in your function folder. To deploy global variables, create a bash script to copy them over to the .env file or include them in your workflow.
27 Jan, 2026, 00:27

<@923897721574817842> functions are isolated serverless environments, so by default they wont have access to your global variables. but you can easily mount the variables that you would like to deploy

when pushing functions using cli you have the option called “—with-variables”, it reads the .env in your function folder. so you can create a bash script to copy over your global variable to the .env or likewise in your workflow

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more