Skip to Content
Author's profile photo Bert Deterd

Deploy a React-Redux Node.js application on SAP HCP with Cloud Foundry

Cloud Foundry has several buildpacks. One of them is the system buildpack node.js. This buildpack enables us to deploy node.js applications on HCP in just a few easy steps.


To deploy a node.js application there are a few prerequisites.These are:

1. Enable the Starter Edition for Cloud Foundry Services

Login to HCP and enable the service Starter Edition for Cloud Foundry Services. Yes, the Cloud Foundry Services are in beta. I have no idea when this will go into production but I cannot imagine this will be too long because it is working.


Go to the service and create an Organization and a project within that organization. There seems to be a litte meshup between the terms because the project you create within an organization is in fact the name you want to remember as the organization when you push your application to HCP-CF. When you’re done creating a project/organization, create a space.

Create a space by first go to Administration and add a subscription to the HCP Starter Edition. Make sure you have the left menu entry “SAP HANA Cloud Platform”.


2. Install cf cli

Cloud Foundry has it’s own command line interface like the Heroku Toolbelt which makes it very easy to deploy a node.js application to HCP.

Deployment process

Now create your application. I created a react-redux application node.js application which I bundled with WebPack but any node.js application you create or have created will do ofcourse .

The steps to follow are :

1. Add files to your node.js application

Add a .cfignore file to the root of your application and add node_modules. This will prevent node_modules being uploaded to HCP. You do not need the node_modules folder since HCP will do a npm install when you deploy your application. The .cfignore is much like your .gitignore file.

Add a Procfile (optional) and add the line:

web: node server/server.js
web: node app.js

Add a manifest.yml file with some basic information about the application

- name: my-reactredux-app


The best way imo is to use npm scripts in package.json and just let HCP execute the script npm start. This would avoid having to create a Procfile. So in my package.json HCP will execute $ node server/server.js


2. Run the cf api / login / push commands

The cf commands are basically the same as Heroku has.

//creates an endpoint
$ cf api
//login to the organization(project) and space
$ cf login -o bertdeterd -s dev
$ cf push


3. check your application

Within the project click on the button MANAGE HCP APPLICATIONS. A project is made up of 1 or several spaces.

Click on the url in Application Routes to see your application working.


And the app:


That’s it. With just a few easy steps you can deploy your node.js application on HCP. If you have a trial HCP account, give it a try.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member


      I am looking in my Hana cockpit at the services section. I have quite a few of them (Git, Web IDE, OAuth), but there's no Cloud Foundry. Any idea how to add that service?



      Author's profile photo Anton Komratov
      Anton Komratov

      Thanks for the post. I'll follow your instructions to create my own app on CF.

      By the way, do you know if this Starter Edition for CF Services is a substitution of XSA on HCP?

      (To be honest, I was waiting for XSA on HCP).

      Author's profile photo Jay Malla
      Jay Malla

      I do not see the option - HCP Starter Edition for Cloud Foundry Services in my trial account.  How do I get this option?

      Author's profile photo Bill Liu
      Bill Liu

      Author's profile photo Former Member
      Former Member

      Hi Guys,


      I have developed an app using react and deployed to Neo trail environment. I would like to bypass the standard HCP login screen as my app has its own custom login functionality. Is deploying to Cloud Foundry the only option ? If so how do I setup my connections using the cloud connector in Cloud Foundry as it seems to be different than in the Neo environment.


      Kind Regards,