SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Understand the Cloud Foundry Application Lifecycle for Buildpack Applications

Understand the application lifecycle in Cloud Foundry and what happens when you cf push.

Overview

🎓 beginner 15 min. SAP BTP Cloud Foundry Runtime And EnvironmentBeginnerCloud

You will learn

  • โœ”What happens when you CF Push
  • โœ”The lifecycle of buildpack applications
  • โœ”Differences between restarting, re-staging, and re-deploying
  • โœ”How Cloud Foundry handles crashes and shutdowns, and the process of evacuation
Beyhan Veli B Beyhan Veli April 13, 2026
Created by September 30, 2021
Contributors

Prerequisites

Steps

Step 1 Push your application to Cloud Foundry
โ€”

When you push an application to Cloud Foundry (cf push), by default it uses a buildpack (either specified by you or auto-detected by Cloud Foundry) to download required dependencies, compile everything needed for your application, and produce a droplet - an artifact - that can be used to run your application in a container. A cf push goes through three phases:

  1. Upload - A record is created in Cloud Foundry for the application, source files are uploaded, and an app package is created

  2. Staging - The required buildpack is downloaded and a droplet is created (using the generated buildpack and app package)

  3. Startup - The app is scheduled to run and is started up (using the droplet) within a container

You can see the full application lifecycle documented at How Apps are Staged. Using the manifest.yml file, you can specify what actually happens during each phase, such as what buildpacks to use, the command to be run on startup, and more. A list of all the possible manifest settings can be found in the official documentation.

To see each phase in action, follow Install the Cloud Foundry Command Line Interface (CLI) to set up the CF CLI and then get the cf-nodejs app as described in Download and Prepare App for Cloud Foundry Deployment. Make sure to change random-route to true in the manifest.yml or have a unique name for the app by changing the app name in the manifest.yml, and then run:

Code
cd <path-to>/cf-sample-app-nodejs
cf push

Once you run the command you will see lots of output print to the screen, and if you look through it carefully you can see where each phase occurs.

The uploading phase begins as follows:

Uploading
Uploading

After that, the staging phase begins. You can see the buildpacks being downloaded (since a specific buildpack is not specified it downloads all of them):

Staging Begins
Staging Begins

You can also see when the droplet get uploaded:

Droplet uploaded
Droplet uploaded

And finally you see the starting phase:

Application starting
Application starting

If you run cf push for an existing application, all instances of that application are stopped and new instances are started with the code you just pushed. Users that try to access the app during this time may get various HTTP error messages, such as “404” (“file not found”) and others, while the application is redeployed. The Cloud Foundry API v3 support the so called Rolling App Deployments with cf push &lt;app-name&gt; --strategy rolling which allows to push an app without downtime. The API v3 are also supported on SAP BTP.

Step 2 Understand when and how to re-start, re-stage, or re-push your application
+
Step 3 Understand application crashes, shutdowns, and evacuations
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Push your application to Cloud Foundry 2. Understand when and how to re-start, re-stage, or re-push your application 3. Understand application crashes, shutdowns, and evacuations

Learn more →