Environment Variable

Qovery makes Environment Variables available to your services at runtime, as well as during builds and deploys.

Here is a short video to show how to use environment variables.

Create an Environment Variable

  1. Navigate to Console

  2. Select your project, environment and application

  3. Select Environment Variables tab in the left panel and click Create button:

    Variables

  4. Select the name and value of your new environment variable

    Variables

    Scopes

Delete an Environment Variable

  1. Navigate to Console

  2. Select your project, environment and application

  3. Select the Environment Variables tab in the left panel

    Variables

  4. Select variable you want to delete and click the Delete button:

    Delete Variables

Update an Environment Variable

  1. Navigate to Console

  2. Select your project, environment and application

  3. Select the Environment Variables tab in the left panel

    Variables

  4. Select variable you want to update and click the Edit button:

    Update Variables

  5. Update the variable in the popup window:

    Update Variables

Override Environment Variable

If you want to override a value of an environment variable, follow those steps:

  1. Navigate to Console

  2. Select your project, environment and application

  3. Select the Environment Variables tab in the left panel

    Variables

  4. Select variable you want to override and click the Override button:

    Override Variables

  5. Override the variable in the popup window:

    Override Variables

Alias Environment Variable

You can create an alias for the existing environment variable.

Let's suppose that your application requires a DATABASE_URL variable. Qovery provides your application with the QOVERY_DATABASE_MY_POSTGRESQL_3498225_URL variable with a database password. Instead of copy-pasting its value, you can create an alias to QOVERY_DATABASE_MY_POSTGRESQL_3498225_URL.

  1. Navigate to Console

  2. Select your project, environment and application

  3. Select the Environment Variables tab in the left panel

    Variables

  4. Select variable you want to alias and click the Alias button:

    ALias Variables

  5. Alias the variable in the popup window:

    Alias Variables

Levels

There are four levels of Environment Variables. Each type differs in scope - you can create variables bound to application, environment, or project.

ScopeLevelDescription
BUILT_IN1Automatically generated variables based on your configuration (e.g., requested databases) propagated to all projects, environments, and applications
PROJECT2Variables at the project level are shared across all environments and all applications of the project
ENVIRONMENT3Variables at the environment level are shared across all applications of the project in one, given environment
APPLICATION4Variables available for one application in one environment

Built-in variables

By default, every environment contains built-in variables:

NameExampleDescription
QOVERY_BRANCH_NAMEmasterGit branch name
QOVERY_IS_PRODUCTIONtrueFlag that indicates production environment

Additional built-in variables

For any added service (database, broker, storage), your application receives additional built-in variables. These can be used, for example, to connect to the database.

Naming Convention:

We use the following naming convention for additional built-in variables:

QOVERY_<SERVICE_TYPE>_<NAME>_<SPEC>

Additional Rules

  • Environment variable keys should use only alphanumeric characters and the underscore character (_) to ensure they are accessible from all programming languages. Environment variable keys should not include the hyphen character.
  • Environment variable keys should not begin with a double underscore (__).
  • An environment variable’s key should not begin with QOVERY_ unless it is set by the Qovery platform itself.