Environment Variables
Environment variables let you pass configuration into your app without hardcoding it into your repository. Use them for database URLs, API keys, feature flags, and any other configuration that shouldn't be committed to source control.
Roundrobin makes every variable you define available to your app both while it builds and while it runs, so the same values that compile your project are also present when it starts.
Managing variables in the dashboard
Environment variables are set per project and apply to every deployment of that project. To manage them:
- Open your project in the Roundrobin dashboard.
- Go to the Environment Variables tab.
- Click Add environment variable to create one, or Import to add several at once.
You can also set initial variables while creating a project — look for the environment variables section in the New Project flow.
Adding a variable
Each variable has a name, a value, and an optional Secret flag.
- Name: may contain letters, numbers, and underscores, and must start with a letter or underscore. By convention, names are written in
UPPER_SNAKE_CASE; the Add dialog uppercases the name for you. Names can be up to 128 characters. - Value: any text up to 1024 characters.
- Secret: marks the env var as a secret, hiding it in the Roundrobin dashboard permanently.
To add environment variables via the UI:
- Navigate to your project in the dashboard
- Click on the Environment variables tab
- Click Add environment variable button
- Enter the variable name and value
- Click Save
Reading variables in your app
Roundrobin injects your variables as standard operating-system environment variables, so you read them the usual way for your language. For example:
// Node.js
const apiKey = process.env.API_KEY;
# Python
import os
api_key = os.environ.get("API_KEY")
# Golang
import "os"
os.Getenv("API_KEY")
The PORT variable
Roundrobin automatically provides a PORT variable that tells your app which port to listen on. Your app's start command must bind to the value of PORT rather than a fixed port number, for example:
const port = process.env.PORT || 3000;
app.listen(port);
If you define PORT yourself, Roundrobin uses your value instead of injecting its own. In most cases you should leave it unset and let the platform manage it.
Secret variables
When you tick the Secret checkbox, the variable becomes secret. Roundrobin still injects it into your app exactly like a normal variable, but:
- Its value cannot be revealed in the dashboard after creation.
- It cannot be edited. To rotate a secret, delete it, create a new one and redeploy your app.
Use secrets for credentials and tokens that nobody — including project members — should be able to read back. Regular (non-secret) variables can be revealed via the dashboard and edited in place.
Importing from a .env file
The Import button lets you bring in many variables at once. Paste your variables in KEY=value format, or upload an existing .env file:
DATABASE_URL=postgres://user:pass@host:5432/db
API_KEY=your-api-key-here
GREETING=hello world
# Comments and blank lines are ignored
How each line is parsed:
- Everything after the first
=in a line becomes the value, so values may themselves contain=. - A line is treated as a comment only when
#is its first non-blank character. A#anywhere inside a value is kept as-is. - Leading and trailing whitespace is trimmed. A single matching pair of surrounding quotes (
"or') is removed; quotes inside the value are kept. - A preview shows every parsed variable so you can mark individual entries as Secret before importing.
Entries with an invalid name or a value over 1024 characters are flagged in the preview and skipped — the rest still import. If an import would push the project past the 100-variable limit, the excess entries fail and are reported back to you.
Applying changes
Environment variables are read when a deployment is built and started. Adding, changing, or removing a variable does not affect a deployment that is already running — you have to redeploy.
To redeploy:
- Open your project and go to the Deployments tab.
- Open the actions menu (
⋯) on the most recent deployment. - Choose Redeploy.
This starts a new deploy which will eventually start a new deploy with your new variable(s).
Next Steps
- Quick Start - Deploy your first app in minutes
- Locations - Find the best location for your app
Still stuck? Contact our support team — we're happy to help.