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
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.
This value is always true
. Your code can check this value to detect whether it's running on Render.
The number of CPUs available for this service, based on its instance type.
For example, this value is 0.5
for the Starter instance type and 2
for the Pro instance type. Note that these are the string values "0.5"
and "2"
. Convert to numbers as needed.
The Render DNS name used to discover all running instances of a scaled service. Has the format $RENDER_SERVICE_NAME-discovery
.
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.
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.
The unique identifier of the current service instance. Useful for scaled services with multiple instances.
The service's unique identifier. Used in the Render API.
The current service's type. One of web
, pserv
, cron
, worker
, static
.
Other environment variables starting with RENDER_
might be present in your build and runtime environments.
However, variables not listed above are strictly for internal use and might change without warning.
Docker
Render does not provide additional environment variables on top of what's listed under All runtimes.
Elixir
Go
Node.js
Python 3
Ruby
Rust
Optional environment variables
You can set these environment variables to modify the default behavior for your services.
All runtimes
For web services, specify the port that your HTTP server binds to.
The default port is 10000
.