Skip to content
Hoody.com

The Container Environment Variables API lets you read, set, bulk-merge, and delete environment variables on a running container. Writes are propagated to two locations inside the container:

  • /etc/environment — picked up by PAM/SSH sessions on the next login.
  • Incus environment.<key> config — visible to incus exec.

Already-running processes keep their original environment until they re-exec. Variable keys must match ^[a-zA-Z_][a-zA-Z0-9_]*$, be at most 256 characters, and must not start with the reserved HOODY_ prefix. Variable values are strings with a maximum length of 32,768 characters.

Retrieve every environment variable currently configured on the container.

NameInTypeRequiredDescription
idpathstringYesContainer ID
Terminal window
curl https://api.hoody.icu/api/v1/containers/cnt_8f3a2b1c/env \
-H "Authorization: Bearer <token>"

Merge environment variables into the container. Existing keys are overwritten with the supplied values, new keys are added, and keys absent from the body are left untouched. Writes are propagated to /etc/environment and to Incus environment.&lt;key&gt;; already-running processes do not pick up the change until they re-exec.

NameInTypeRequiredDescription
idpathstringYesContainer ID

The body is a JSON object whose keys are environment variable names and whose values are the corresponding string values.

  • Between 1 and 200 keys per request.
  • Each key must match ^[a-zA-Z_][a-zA-Z0-9_]*$, be at most 256 characters, and must not start with HOODY_.
  • Each value is a string with a maximum length of 32,768 characters.
Terminal window
curl -X PUT https://api.hoody.icu/api/v1/containers/cnt_8f3a2b1c/env \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"NODE_ENV": "production",
"LOG_LEVEL": "info",
"FEATURE_FLAG_NEW_UI": "true"
}'

Create or update one environment variable on the container. Writes are propagated to /etc/environment and to Incus environment.&lt;key&gt;; already-running processes do not pick up the change until they re-exec.

NameInTypeRequiredDescription
idpathstringYesContainer ID
keypathstringYesEnvironment variable key
NameTypeRequiredDescription
valuestringYesValue for the environment variable. Maximum length: 32,768 characters.
Terminal window
curl -X PUT https://api.hoody.icu/api/v1/containers/cnt_8f3a2b1c/env/NODE_ENV \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "value": "production" }'

Remove a single environment variable from the container. The operation is idempotent — the response is 200 whether or not the key previously existed. The variable is removed from /etc/environment (new PAM/SSH logins will no longer see it) and unset from Incus environment.&lt;key&gt;. Already-running processes keep their copy until they re-exec.

NameInTypeRequiredDescription
idpathstringYesContainer ID
keypathstringYesEnvironment variable key
Terminal window
curl -X DELETE https://api.hoody.icu/api/v1/containers/cnt_8f3a2b1c/env/NODE_ENV \
-H "Authorization: Bearer <token>"