Set environment variables
Most applications need some configuration when they start: the address of a database, a log level, a feature flag. On the GLBNXT Platform you supply these as environment variables, and the platform hands them to your container every time it starts.
This guide covers adding them when you deploy an application, changing them afterwards, and pasting in a .env file you already have.
Add variables one at a time
You can add variables on the deploy form, below Container image, or later on the application page, below Runtime. Both use the same Environment variables card.
Click Add variable. A row appears with a Name and a Value field.
Type the name, then the value. Names are usually written in capitals with underscores, for example
DATABASE_HOST.Repeat for each variable your application needs.
On the deploy form, deploy as normal. On the application page, choose Save and restart.

A row you left completely empty is ignored. A row with only a name or only a value is reported as an error.
Paste a .env file
If you already have the variables in a file, you can paste it in one go.
Switch the card to the text view. On the deploy form, click Edit as .env in the card header. On the application page, choose the .env tab. The rows are replaced by a single text box.
Paste the contents of your file.
Switch back the same way: Edit as list on the deploy form, or the List tab on the application page.

The text is read as one NAME=value per line. Blank lines and lines starting with # are ignored, a leading export is removed, and surrounding quotes are stripped from the value. Everything after the first = is the value, so a line like DSN=postgres://user:pass@host/db?a=b works as you would expect.
Each value must be on one line. If a value wraps onto a second line, the message names that line and your text stays exactly as you pasted it.
Change or remove a variable
In My Apps, choose Manage next to the application. The Environment variables card sits below Runtime.
Click in a name or value and type your change. Each changed row is marked Unsaved.
To remove a variable, click the bin icon at the end of its row.
Choose Save and restart to apply your changes, or Discard to undo them.
All your changes are applied together when you choose Save and restart.
What happens when you save
Your application restarts with the new values. It keeps its address, and the restart takes about as long as a normal deploy. Anything the application was holding only in memory is lost, as with any other restart.
If a name is refused
Some names are not allowed: the platform reserves the GLBNXT_ prefix for the variables it supplies itself, and a name has to be a valid environment variable name. The message appears under the row it is about, and nothing else you typed is lost. Environment variable rules lists every rule in full.
Last updated
Was this helpful?