Node.js is a popular JavaScript runtime built on Chrome's V8 JavaScript engine. supports deploying Node.js applications quickly and easily. Using our Multi-App support you can build a micro-service oriented system mixing both Javascript and PHP applications.

Supported versions

  • 6.11
  • 8.9
  • 10

If you need other versions, take a look at our options for installing them with NVM.

Deprecated versions

The following versions are available but are not receiving security updates from upstream, so their use is not recommended. They will be removed at some point in the future.

  • 0.12
  • 4.7
  • 4.8
  • 6.9
  • 6.10
  • 8.2

See for a full example with MongoDB support.


To use and Node.js together, configure the file with a few key settings, as described here (a complete example is included at the end).

  1. Specify the language of your application (available versions are listed above):

    type: "nodejs:10"
  2. Specify your dependencies under the nodejs key, like this:

        pm2: "^2.5.0"

    These are the global dependencies of your project (the ones you would have installed with npm install -g). Here we specify the pm2 process manager that will allow us to run the node process.

  3. Configure the command you use to start serving your application (this must be a foreground-running process) under the web section, e.g.:

        start: "PM2_HOME=/app/run pm2 start index.js --no-daemon"

    If there is a package.json file present at the root of your repository, will automatically install the dependencies. We suggest including the platformsh helper npm module, which makes it trivial to access the running environement.

    "dependencies": {
      "platformsh": "^0.0.1"
  4. Create any Read/Write mounts. The root file system is read only. You must explicitly describe writable mounts. In (3) we set the home of the process manager to /app/run so this needs to be writable.

            source: local
            source_path: run
  5. Include any relevant commands needed to build and setup your application in the hooks section, e.g.:

      build: |
        npm install
        npm run build
        bower install
  6. Setup the routes to your nodejs application in .platform/routes.yaml.

  type: upstream
  upstream: "app:http"

Here's a complete example that also serves static assets (.png from the /public directory):

name: node
type: nodejs:10

    start: "PM2_HOME=/app/run pm2 start index.js --no-daemon"
    #in this setup you will find your application stdout and stderr in /app/run/logs
      passthru: false
      root: "public"
      # Whether to allow files not matching a rule or not.
      allow: true
          allow: true
          expires: -1
    pm2: "^2.5.0"
       source: local
       source_path: run
disk: 512

In your application...

Finally, make sure your Node.js application is configured to listen over the port given by the environment (here we use the platformsh helper and get it from config.port) that is available in the environment variable PORT. Here's an example:

// Load the http module to create an http server.
var http = require('http');
// Load the configuration
var config= require("platformsh").config();

var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/html"});
  response.end("<html><head><title>Hello Node.js</title></head><body><h1><img src='public/js.png'>Hello Node.js</h1><h3>Platform configuration:</h3><pre>"+JSON.stringify(config, null, 4) + "</pre></body></html>");


Project templates

A number of project templates for Node.js applications and typical configurations are available on GitHub. Not all of them are proactively maintained but all can be used as a starting point or reference for building your own website or web application. also provides a helper library for Node.js applications that simplifies presenting environment information to your application. It is not required to run Node.js applications on but is recommended.