Environment Variables on Render
Render exposes configuration to services as environment variables. Values are always strings at the platform layer—applications must parse numbers, booleans, and structured data explicitly.
There are three primary ways to set variables:
- Render Dashboard — per-service UI, bulk import from
.env, save/redeploy options
- Blueprint —
envVars (and related keys) in render.yaml
- MCP / API — e.g.
update_environment_variables on a service
Deep wiring patterns, full platform variable tables, and language-specific notes live under references/.
When to Use This Skill
Use this skill when users want to:
- Add, change, or remove environment variables or secrets
- Understand Dashboard vs Blueprint vs API/MCP flows
- Use environment groups for shared configuration
- Wire
fromDatabase, fromService, fromGroup, sync: false, or generateValue in Blueprints
- Debug missing vars, secret files, precedence, or platform-injected names
For full Blueprint authoring, pair with render-blueprints. For first-time deploys, render-deploy. For web service behavior and ports, render-web-services.
Setting Variables
Dashboard
- Add variables individually (name + value) or in bulk by pasting/uploading a
.env-style file.
- Save options typically include:
- Save and rebuild & deploy — picks up build-time changes
- Deploy only — runtime change without a full rebuild (when applicable)
- Save only — persist without triggering a deploy
Use Dashboard edits when iterating quickly or when the repo should not carry certain values.
Blueprint (render.yaml)
Declare envVars on each service. Values can be literals, generated secrets, sync-disabled prompts, or references to databases, other services, or env groups. See Blueprint Wiring below and references/wiring-reference.md for exhaustive patterns and YAML.
MCP / API
Automation tools can set variables on existing services (e.g. update_environment_variables). Useful for CI, rotation, or keeping Dashboard state in sync with external secret stores—without committing secrets to Git.
Secret Management
sync: false — Render prompts in the Dashboard for the value only on initial Blueprint setup when the resource is first created. On Blueprint updates, sync: false is ignored (values are not re-prompted from the file alone). These vars are excluded from preview environments and are invalid inside environment groups.
generateValue: true — Render generates a base64-encoded 256-bit random value at provision time. Use for passwords, signing keys, or tokens that do not need human-chosen values.
- Never commit real secrets in
render.yaml as plain value: entries. Prefer Dashboard, secret manager integration, generateValue, or sync: false with Dashboard entry.
Secret files
- Store sensitive file content as secret files (not inline env strings). They appear as plaintext files under
/etc/secrets/<filename>.
- Combined limit: 1 MB total secret file payload per service or per linked env group (as applicable to your setup).
- Docker: secret files are available under
/etc/secrets/ on the running instance.
Environment Groups
Environment groups are named collections of variables linked to multiple services.
- Precedence: Service-level variables override variables from linked groups with the same name.
- Multiple groups on one service: the group that was most recently created wins for overlapping keys. This ordering is not documented as stable—avoid relying on it; use distinct names or consolidate groups.
- Groups can be scoped to a project environment so staging and production differ without duplicating every service definition.
Blueprint Wiring (Summary)
Full syntax, examples, and edge cases: references/wiring-reference.md. Authoritative Blueprint docs: render-blueprints skill.
| Mechanism |
Role |
value |
Hardcoded string (non-secret config only) |
generateValue: true |
Platform-generated secret |
sync: false |
Dashboard prompt on initial create only |
fromDatabase |
Inject DB fields (connectionString, host, port, user, password, database) |
fromService |
Key Value: type: keyvalue + properties; private/web: host, hostport, or envVarKey |
fromGroup |
Link all vars from a named group |
Platform-Injected Variables
Render sets read-only variables your app can read at runtime (and some at build). A concise list:
| Variable |
Typical meaning |
RENDER |
"true" when running on Render |
RENDER_SERVICE_TYPE |
Service kind (e.g. web, worker) |
RENDER_SERVICE_ID |
Service identifier |
RENDER_SERVICE_NAME |
Human-readable service name |
RENDER_INSTANCE_ID |
Current instance |
RENDER_EXTERNAL_URL |
Public URL (when applicable) |
RENDER_EXTERNAL_HOSTNAME |
Public hostname |
RENDER_DISCOVERY_SERVICE |
Service discovery hostname (private network) |
RENDER_GIT_COMMIT |
Deployed commit SHA |
RENDER_GIT_BRANCH |
Branch for this deploy |
PORT |
HTTP port to bind (default 10000) |
IS_PULL_REQUEST |
Preview deploy indicator |
RENDER_CPU_COUNT |
vCPU count for the instance |
RENDER_WEB_CONCURRENCY |
Suggested worker/process count hint |
Build vs runtime availability, language version env vars, and WEB_CONCURRENCY defaults: references/platform-variables.md.
Runtime-Specific Defaults
Render and buildpacks may set defaults (verify in your service’s Environment tab):
| Runtime |
Notable defaults |
| Node.js |
NODE_ENV=production |
| Python |
PYTHON_VERSION (pinned by build); Gunicorn-oriented images often set GUNICORN_CMD_ARGS to bind 0.0.0.0:10000 |
| Ruby |
RAILS_ENV=production, RAILS_LOG_TO_STDOUT=true |
| Go |
GO111MODULE=on (legacy modules flag; still seen on older stacks) |
| Rust |
ROCKET_PORT=10000 (Rocket convention) |
Always bind HTTP servers to 0.0.0.0 and PORT (or the stack’s documented port env) unless using a static site or custom Docker entrypoint.
Common Issues
- Everything is a string —
DEBUG=false is truthy in many parsers; use explicit comparison or typed config loaders.
WEB_CONCURRENCY — Default behavior changed for services created after December 8, 2025. Compare with older services when debugging worker counts; see references/platform-variables.md.
- Undocumented
RENDER_* variables — Names and semantics may change; do not depend on undocumented injection for critical logic.
- Blueprint vs Dashboard drift — Editing only
render.yaml does not retroactively apply sync: false prompts on update; merge strategy for env keys is easy to misunderstand—test in a scratch service.
- Secret file paths — Code must read
/etc/secrets/<filename>; wrong paths or missing mounts usually show as file-not-found at runtime.
References
references/wiring-reference.md — Complete Blueprint envVar wiring, YAML examples, precedence, edge cases
references/platform-variables.md — Injected variables (build vs runtime), language versions, concurrency, reading vars from code
Related Skills
- render-blueprints — Full Blueprint authoring, validation, multi-service layouts
- render-deploy — First deploy, repo requirements, MCP vs YAML
- render-web-services — Ports, health checks, scaling behavior tied to env-driven servers
1---2name: render-env-vars3description: >-4 Configures environment variables, secrets, and env groups on Render. Use when5 the user needs to set env vars, wire secrets between services, create env6 groups, use generateValue, set sync: false, or troubleshoot missing or7 incorrect environment variable values in Blueprints or the Dashboard.8license: MIT9compatibility: Render Dashboard, CLI, or MCP tools10metadata:11 source: https://skillmd.com/skills/concertonotes/render-env-vars12 author: Render13 version: "1.0.0"14 category: configuration15---1617# Environment Variables on Render1819Render exposes configuration to services as **environment variables**. Values are always **strings** at the platform layer—applications must parse numbers, booleans, and structured data explicitly.2021There are **three** primary ways to set variables:22231. **Render Dashboard** — per-service UI, bulk import from `.env`, save/redeploy options242. **Blueprint** — `envVars` (and related keys) in `render.yaml`253. **MCP / API** — e.g. `update_environment_variables` on a service2627Deep wiring patterns, full platform variable tables, and language-specific notes live under `references/`.2829## When to Use This Skill3031Use this skill when users want to:3233- Add, change, or remove environment variables or secrets34- Understand Dashboard vs Blueprint vs API/MCP flows35- Use **environment groups** for shared configuration36- Wire `fromDatabase`, `fromService`, `fromGroup`, `sync: false`, or `generateValue` in Blueprints37- Debug missing vars, secret files, precedence, or platform-injected names3839For full Blueprint authoring, pair with **render-blueprints**. For first-time deploys, **render-deploy**. For web service behavior and ports, **render-web-services**.4041## Setting Variables4243### Dashboard4445- Add variables **individually** (name + value) or **in bulk** by pasting/uploading a `.env`-style file.46- **Save options** typically include:47 - **Save and rebuild & deploy** — picks up build-time changes48 - **Deploy only** — runtime change without a full rebuild (when applicable)49 - **Save only** — persist without triggering a deploy5051Use Dashboard edits when iterating quickly or when the repo should not carry certain values.5253### Blueprint (`render.yaml`)5455Declare `envVars` on each service. Values can be literals, generated secrets, sync-disabled prompts, or references to databases, other services, or env groups. See **Blueprint Wiring** below and `references/wiring-reference.md` for exhaustive patterns and YAML.5657### MCP / API5859Automation tools can set variables on existing services (e.g. `update_environment_variables`). Useful for CI, rotation, or keeping Dashboard state in sync with external secret stores—without committing secrets to Git.6061## Secret Management6263- **`sync: false`** — Render prompts in the Dashboard for the value **only on initial Blueprint setup** when the resource is first created. On **Blueprint updates**, `sync: false` is **ignored** (values are not re-prompted from the file alone). These vars are **excluded from preview environments** and are **invalid inside environment groups**.64- **`generateValue: true`** — Render generates a **base64-encoded 256-bit** random value at provision time. Use for passwords, signing keys, or tokens that do not need human-chosen values.65- **Never commit real secrets** in `render.yaml` as plain `value:` entries. Prefer Dashboard, secret manager integration, `generateValue`, or `sync: false` with Dashboard entry.6667### Secret files6869- Store sensitive file content as **secret files** (not inline env strings). They appear as **plaintext files** under **`/etc/secrets/<filename>`**.70- **Combined limit**: **1 MB** total secret file payload per service or per linked env group (as applicable to your setup).71- **Docker**: secret files are available under **`/etc/secrets/`** on the running instance.7273## Environment Groups7475**Environment groups** are named collections of variables linked to **multiple services**.7677- **Precedence**: **Service-level** variables **override** variables from linked groups with the same name.78- **Multiple groups** on one service: the group that was **most recently created** wins for overlapping keys. This ordering is **not documented as stable**—avoid relying on it; use distinct names or consolidate groups.79- Groups can be **scoped to a project environment** so staging and production differ without duplicating every service definition.8081## Blueprint Wiring (Summary)8283Full syntax, examples, and edge cases: `references/wiring-reference.md`. Authoritative Blueprint docs: **render-blueprints** skill.8485| Mechanism | Role |86|-----------|------|87| `value` | Hardcoded string (non-secret config only) |88| `generateValue: true` | Platform-generated secret |89| `sync: false` | Dashboard prompt on **initial** create only |90| `fromDatabase` | Inject DB fields (`connectionString`, `host`, `port`, `user`, `password`, `database`) |91| `fromService` | Key Value: `type: keyvalue` + properties; private/web: `host`, `hostport`, or `envVarKey` |92| `fromGroup` | Link all vars from a named group |9394## Platform-Injected Variables9596Render sets **read-only** variables your app can read at runtime (and some at build). A concise list:9798| Variable | Typical meaning |99|----------|-----------------|100| `RENDER` | `"true"` when running on Render |101| `RENDER_SERVICE_TYPE` | Service kind (e.g. web, worker) |102| `RENDER_SERVICE_ID` | Service identifier |103| `RENDER_SERVICE_NAME` | Human-readable service name |104| `RENDER_INSTANCE_ID` | Current instance |105| `RENDER_EXTERNAL_URL` | Public URL (when applicable) |106| `RENDER_EXTERNAL_HOSTNAME` | Public hostname |107| `RENDER_DISCOVERY_SERVICE` | Service discovery hostname (private network) |108| `RENDER_GIT_COMMIT` | Deployed commit SHA |109| `RENDER_GIT_BRANCH` | Branch for this deploy |110| `PORT` | HTTP port to bind (**default `10000`**) |111| `IS_PULL_REQUEST` | Preview deploy indicator |112| `RENDER_CPU_COUNT` | vCPU count for the instance |113| `RENDER_WEB_CONCURRENCY` | Suggested worker/process count hint |114115Build vs runtime availability, language version env vars, and **WEB_CONCURRENCY** defaults: `references/platform-variables.md`.116117## Runtime-Specific Defaults118119Render and buildpacks may set defaults (verify in your service’s **Environment** tab):120121| Runtime | Notable defaults |122|---------|------------------|123| **Node.js** | `NODE_ENV=production` |124| **Python** | `PYTHON_VERSION` (pinned by build); Gunicorn-oriented images often set `GUNICORN_CMD_ARGS` to bind **`0.0.0.0:10000`** |125| **Ruby** | `RAILS_ENV=production`, `RAILS_LOG_TO_STDOUT=true` |126| **Go** | `GO111MODULE=on` (legacy modules flag; still seen on older stacks) |127| **Rust** | `ROCKET_PORT=10000` (Rocket convention) |128129Always bind HTTP servers to **`0.0.0.0`** and **`PORT`** (or the stack’s documented port env) unless using a static site or custom Docker entrypoint.130131## Common Issues1321331. **Everything is a string** — `DEBUG=false` is truthy in many parsers; use explicit comparison or typed config loaders.1342. **`WEB_CONCURRENCY`** — Default behavior changed for services **created after December 8, 2025**. Compare with older services when debugging worker counts; see `references/platform-variables.md`.1353. **Undocumented `RENDER_*` variables** — Names and semantics may change; do not depend on undocumented injection for critical logic.1364. **Blueprint vs Dashboard drift** — Editing only `render.yaml` does not retroactively apply `sync: false` prompts on update; merge strategy for env keys is easy to misunderstand—test in a scratch service.1375. **Secret file paths** — Code must read **`/etc/secrets/<filename>`**; wrong paths or missing mounts usually show as file-not-found at runtime.138139## References140141- `references/wiring-reference.md` — Complete Blueprint `envVar` wiring, YAML examples, precedence, edge cases142- `references/platform-variables.md` — Injected variables (build vs runtime), language versions, concurrency, reading vars from code143144## Related Skills145146- **render-blueprints** — Full Blueprint authoring, validation, multi-service layouts147- **render-deploy** — First deploy, repo requirements, MCP vs YAML148- **render-web-services** — Ports, health checks, scaling behavior tied to env-driven servers