Node.js 14 is now generally available.

Node.js Runtime Environment

The Node.js runtime is the software stack responsible for installing your web service's code and its dependencies and running your service.

The Node.js runtime for App Engine in the standard environment is declared in the app.yaml file:

Node.js 14

runtime: nodejs14

Node.js 12

runtime: nodejs12

Node.js 10

runtime: nodejs10

Node.js 8 (deprecated)

runtime: nodejs8

Node.js version

The Node.js runtime supports Node.js 14, Node.js 12, Node.js 10, and Node.js 8 (deprecated). The runtime uses the latest stable release of the version that is specified in your app.yaml file. App Engine automatically updates to new patch and minor release versions, but it will not automatically update the major version.

For example, your application might be deployed at Node.js 10.9.4 and later automatically updated to version 10.10.0, but it will not be automatically updated to Node.js 12.x.x.

Because minor and patch versions are automatically updated, the engines.node property in your package.json file can only specify the major version:

Node.js 14

  "engines": {
    "node": "14.x.x"

Node.js 12

  "engines": {
    "node": "12.x.x"

Node.js 10

  "engines": {
    "node": "10.x.x"

Node.js 8 (deprecated)

  "engines": {
    "node": "8.x.x"

The engines.node property is optional, but if present, the value must be compatible with the Node.js version specified in your app.yaml file. For example:

Node.js 14

  • 14.x.x
  • ^14.0.0
  • ~14
  • >=6

Node.js 12

  • 12.x.x
  • ^12.0.0
  • ~12
  • >=6

Node.js 10

  • 10.x.x
  • ^10.0.0
  • ~10
  • >=6

Node.js 8 (deprecated)

  • 8.x.x
  • ^8.0.0
  • ~8
  • >=6

If you specify an incompatible Node.js version in your package.json file, your deployment will fail with an error message.


During deployment, the runtime installs your dependencies using the npm install command or, if a yarn.lock file exists, the yarn install command. For more information, see Specifying Dependencies. Because the runtime performs a fresh install, you do not need to upload your node_modules folder.

To support Node.js packages that require native extensions, the runtime includes system packages enabling you to use tools such as ImageMagick, FFmpeg, and Chrome headless. See the full list of packages at Included System Packages. To request a package, file an issue in the issue tracker.

Application startup

By default, the runtime starts your application by running node server.js. If you specify a start script in your package.json file, the runtime runs the specified start script instead. For example:

"scripts": {
  "start": "node app.js"

For your app to receive HTTP requests, your start script should start a web server that listens on host and the port specified by the PORT environment variable, which is accessible in Node.js as process.env.PORT.

For the best performance, the start script should be lightweight and exclude build steps, because it runs whenever a new instance of your application is created.

You can override this behavior by specifying a script in the entrypoint field in app.yaml. Instead of running node server.js or a start script, the runtime starts your application with the command you specify in entrypoint.

Environment variables

The following environment variables are set by the runtime:

Environment variable Description
GAE_APPLICATION The ID of your App Engine application. This ID is prefixed with 'region code~' such as 'e~' for applications deployed in Europe.
GAE_DEPLOYMENT_ID The ID of the current deployment.
GAE_ENV The App Engine environment. Set to standard.
GAE_INSTANCE The ID of the instance on which your service is currently running.
GAE_MEMORY_MB The amount of memory available to the application process, in MB.
GAE_RUNTIME The runtime specified in your app.yaml file.
GAE_SERVICE The service name specified in your app.yaml file. If no service name is specified, it is set to default.
GAE_VERSION The current version label of your service.
GOOGLE_CLOUD_PROJECT The Cloud project ID associated with your application.
NODE_ENV Set to production when your service is deployed.
PORT The port that receives HTTP requests.

You can define additional environment variables in your app.yaml file, but the above values cannot be overridden, except for NODE_ENV.

HTTPS and forwarding proxies

App Engine terminates HTTPS connections at the load balancer and forwards requests to your application. Some applications need to determine the original request IP and protocol. The user's IP address is available in the standard X-Forwarded-For header. Applications that require this information should configure their web framework to trust the proxy.

With Express.js, use the trust proxy setting:

app.set('trust proxy', true);


The runtime includes a full filesystem. The filesystem is read-only except for the location /tmp, which is a virtual disk storing data in your App Engine instance's RAM.

Metadata server

Each instance of your application can use the App Engine metadata server to query information about the instance and your project.

You can access the metadata server through the following endpoints:

  • http://metadata

The following table lists the endpoints where you can make HTTP requests for specific metadata:

Metadata endpoint Description
/computeMetadata/v1/project/numeric-project-id The project number assigned to your project.
/computeMetadata/v1/project/project-id The project ID assigned to your project.
/computeMetadata/v1/instance/zone The zone the instance is running in.
/computeMetadata/v1/instance/service-accounts/default/email The default service account email assigned to your project.
/computeMetadata/v1/instance/service-accounts/default/ Lists all the default service accounts for your project.
/computeMetadata/v1/instance/service-accounts/default/scopes Lists all the supported scopes for the default service accounts.
/computeMetadata/v1/instance/service-accounts/default/token Returns the auth token that can be used to authenticate your application to other Google Cloud APIs.

For example, to retrieve your project ID, send a request to