# Environment variables

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

1. In **Deploy**, go to the **Configure** step.
2. Under **Environment variables**, select **Add variable**.
3. Enter a name and a value. Use **Show value** to check what you typed.
4. 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_PRELOAD` and `LD_LIBRARY_PATH` are 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](/docs/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](/docs/server-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](/docs/variable-sets) and attach it in the deploy wizard.
