Environment variables pass settings to the software on your server, for example a model name. They are given to the server when it starts.
Set them
- In Deploy, go to the Configure step.
- Under Environment variables, select Add variable.
- Enter a name and a value. Use Show value to check what you typed.
- Continue to the review step, which shows how many variables you set.
Variables that the template defines appear first, marked From template. You can change their values. To add many at once, paste the contents of a .env file into a name field.
Rules
- A name starts with a letter or underscore, and then uses letters, numbers and underscores. We recommend capital letters.
- Names must be unique.
PATH,LD_PRELOADandLD_LIBRARY_PATHare reserved.- You can set up to 50 variables. A value can have up to 4,096 characters.
What to keep out
Keep tokens in Secrets and set the variable to secret:NAME instead of pasting the value. Do not store secrets you cannot rotate. If a token must be used on a server, create one with limited rights, and revoke it when you destroy the server. Never use variables for passwords you use elsewhere.
Change them later
You set variables when you request a server. You cannot edit them on a running server. To change one, deploy a new server with the new value, or set the variable inside the server yourself.
Check them
In the software that uses the variable, check its own settings or logs. See Logs and usage. If a value is missing, check the name for typos and deploy again.
Variable sets
To reuse the same variables on many servers, save them once as a variable set and attach it in the deploy wizard.
Ready to try it?
Create a free account and add credit when you want to start a server. The smallest top-up is $10.
Was this helpful?