Default Environment Variables

Render automatically sets the values of certain environment variables for your service.

Unless otherwise noted, these environment variables are available at both build time and runtime.

Environment variable values are always strings.

In your application logic, perform any necessary conversions for variable values that represent other data types, such as "false" or "10000".

By runtime

All runtimes

Environment VariableValue

IS_PULL_REQUEST

This value is true for pull request previews and false otherwise.

Note that these are the string values "true" and "false". Convert to booleans as needed.

RENDER

This value is always true. You can use this to detect whether your service is running on Render.

RENDER_DISCOVERY_SERVICE

The Render DNS name used to discover all running instances of a scaled service. Has the format $RENDER_SERVICE_NAME-discovery.

RENDER_EXTERNAL_HOSTNAME

For a web service or static site, this is the service’s onrender.com hostname (such as myapp.onrender.com).

For other service types, this value is empty.

RENDER_EXTERNAL_URL

For a web service or static site, this is the service’s full onrender.com URL (such as https://myapp.onrender.com).

For other service types, this value is empty.

RENDER_GIT_BRANCH

The Git branch for a service or deploy.

RENDER_GIT_COMMIT

The commit SHA for a service or deploy.

RENDER_GIT_REPO_SLUG

Has the format $username/$reponame.

RENDER_INSTANCE_ID

The unique identifier of the current service instance. Useful for scaled services with multiple instances.

RENDER_SERVICE_ID

The service’s unique identifier. Used in the Render API.

RENDER_SERVICE_NAME

A unique, human-readable identifier for a service.

RENDER_SERVICE_TYPE

The current service’s type. One of web, pserv, cron, worker, static.

Other environment variables beginning with RENDER_ may be included in your build and runtime environments. However, variables not listed above are strictly for internal use and can change without warning.

Docker

Render does not provide additional environment variables on top of what’s listed under All runtimes.

Elixir

Environment Variable

Value

MIX_ENV

prod

RELEASE_DISTRIBUTION

name

Go

Environment VariableValue

GO111MODULE

on

GOPATH

/opt/render/project/go

Node

Environment VariableValue

NODE_ENV

production (runtime only)

NODE_MODULES_CACHE

true

Python 3

Environment VariableValue

CI

true (build time only)

FORWARDED_ALLOW_IPS

*

GUNICORN_CMD_ARGS

--preload --access-logfile - --bind=0.0.0.0:10000

PIPENV_YES

true

PYTHON_VERSION

3.7.10

VENV_ROOT

/opt/render/project/src/.venv

Ruby

Environment VariableValue

BUNDLE_APP_CONFIG

/opt/render/project/.gems

BUNDLE_BIN

/opt/render/project/.gems/bin

BUNDLE_DEPLOYMENT

true

BUNDLE_PATH

/opt/render/project/.gems

GEM_PATH

/opt/render/project/.gems

MALLOC_ARENA_MAX

2

PASSENGER_ENGINE

builtin

PASSENGER_ENVIRONMENT

production

PASSENGER_PORT

10000

PIDFILE

/tmp/puma-server.pid

RAILS_ENV

production

RAILS_SERVE_STATIC_FILES

true

RAILS_LOG_TO_STDOUT

true

Rust

Environment VariableValue

CARGO_HOME

/opt/render/project/.cargo

ROCKET_ENV

prod

ROCKET_PORT

10000 (runtime only)

RUSTUP_HOME

/opt/render/project/.rustup

Optional environment variables

You can set these environment variables to modify the default behavior for your services.

All runtimes

Environment VariableValue

PORT

For web services, specify the port that your HTTP server binds to.

The default port is 10000.

Node.js

Environment VariableValue

SKIP_INSTALL_DEPS

Set this to true to skip running yarn/npm install during build.

NODE_VERSION

See Setting Your Node.js Version.

Setting environment variables

Render supports environment variables, configuration files, and secrets and lets you manage them at different levels of granularity to simplify your deployment processes.

See Environment Variables and Secrets.