Skip to content

Environment variables

Environment variables store configuration and secrets your app reads at runtime — database URLs, API keys, feature flags, and more. They’re part of the app’s configuration and can be changed without a full redeploy.

Environment variables live in an app’s env array — a list of { name, value } pairs:

{
"env": [
{ "name": "DATABASE_URL", "value": "postgres://user:pass@host:5432/db" },
{ "name": "DEBUG", "value": "true" }
]
}

From the dashboard, edit the app’s Environment variables. From the API, include the full env array in a PUT /apps call (updates replace the whole config, so include every variable you want to keep):

Terminal window
curl -X PUT https://api.cumin.dev/apps \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<app-id>",
"project_id": "…",
"name": "my-api",
"image": "docker.io/nginx:latest",
"ports": [{ "name": "web", "number": 80 }],
"env": [
{ "name": "DATABASE_URL", "value": "postgres://user:pass@host:5432/db" },
{ "name": "DEBUG", "value": "true" }
],
"cpu": 256,
"memory": 512,
"instances": 1,
"hibernated": false
}'

Setting a key that already exists overwrites its value. Remove a variable by omitting it from the env array.

Read them the standard way for your language:

import os
DATABASE_URL = os.environ["DATABASE_URL"]
const dbUrl = process.env.DATABASE_URL;

Environment variables are visible in the app’s configuration. For anything that must stay encrypted and out of config listings — API keys, signing secrets, database passwords — store it in Secrets instead.