Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Hi All,

I am writing this blog to describe some easy steps to deploy a Node.js application into the SAP cloud foundry environment.

It is the first time for me to setup Node.js environment, so there may be some mistakes on this article.



Local PC

  • Ubuntu18.04.01 LTS on VMWare Workstation

  • cf CLI 6.43.0

  • node.js 11.10.1

  • npm 6.7.0

Cloud Foundry

  • Nodejs Buildpack version 1.6.40

  • CF Trial (Europe – Frankfurt)


  • your space is created on Cloud Foundry environment

  • cf CLI is installed on Local PC(see the official page for the installation)


1. Install Node.js

Since I have never used Node.js on my local PC, I installed Node.js first.
# Install Node.js using PPA
curl -sL | sudo -E bash -
apt show nodejs
sudo apt install nodejs

# Check if it is successful
node --version
nmp --version


2. Run Hello world for checking Node.js

# Create a folder
mkdir sample && cd sample

# Create hello.js, which shows just "Hello world"
echo 'console.log("Hello, World!");' > hello.js

# Run
node hello.js


3. Clone sample repository

Clone sample repository from GitHub.
# Clone repository
git clone -b 1_REST_persist_in_Memory
cd cloud-cf-helloworld-nodejs

# configure npm
npm config set @sap:registry

# npm instll
npm install
npm install --save express body-parser axios


4. Try Node.js on local PC

Run Node.js and see the result via browser.
# From directry of cloned
nodejs server.js


Open URL via browser.



5. Deploy the app into Cloud Foundry

Using CF CLI, login and deploy the app into Cloud Foundly
cf api
cf login

# From directory of cloned repository
cf push sample-nodejs

Successfully deployed!

Now it works on Public internet space.




Node.js dependent information is in package.json.
"name": "SAP-CP-CF-HelloWorld",
"description": "Sample SAP-CP-CF Hello World Restful Service",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "4.15.3",
"body-parser": "1.17.2"
"engines": {
"node": "6.x.x"
"scripts": {
"start": "node server.js"


Cloud Foundry dependent information is in manifest.yml.
- name: sapcpcfhw
path: .
buildpack: nodejs_buildpack
memory: 128M