Skip to content

Environment Variables

Environment variables let you inject configuration into your apps at runtime without baking secrets into your Docker image.

Use the --env flag when creating an app. You can pass multiple variables:

Terminal window
zerokie apps create \
--name my-api \
--image my-registry.com/my-api:latest \
--port 3000 \
--env DATABASE_URL=postgres://user:pass@host:5432/db \
--env NODE_ENV=production

Each --env flag sets one variable in the format KEY=VALUE.

VariablePurpose
DATABASE_URLDatabase connection string
NODE_ENVNode.js environment (production, development)
API_KEYThird-party service credentials
PORTOverride the default listening port (if your app reads $PORT)

Environment variables are stored securely within the platform infrastructure and are only exposed to the running container. They are not visible in logs or API responses.

Avoid passing sensitive values directly on the command line in shared environments. Consider using a secrets manager and injecting references instead.