About Starting Applications

Page last updated: December 2, 2015

This page assumes you are using cf CLI v6.

cf push starts your application with a command from one of three sources:

  1. The -c command-line option, for example:

    $ cf push my-app -c "node my-app.js"

  2. The command attribute in the application manifest, for example:

    command: node my-app.js

  3. The buildpack, which provides a start command appropriate for a particular type of application.

The source that the cf CLI uses depends on factors explained below.

How cf push Determines its Default Start Command

The first time you deploy an application, cf push uses the buildpack start command by default. After that, cf push defaults to whatever start command was used for the previous push.

To override these defaults, provide the -c option, or the command attribute in the manifest. When you provide start commands both at the command line and in the manifest, cf push ignores the command in the manifest.

Forcing cf push to use the Buildpack Start Command

To force the cf CLI to use the buildpack start command, specify a start command of null.

You can specify a null start command in one of two ways.

  1. Using the -c command-line option:

    $ cf push my-app -c "null"

  2. Using the command attribute in the application manifest:

    command: null

This can be helpful after you have deployed while providing a start command at the command line or the manifest. At this point, a command that you provided, rather than the buildpack start command, has become the default start command. In this situation, if you decide to deploy using the buildpack start command, the null command makes that easy.

Start Commands when Migrating a Database

Start commands are used in special ways when you migrate a database as part of an application deployment. See Migrating a Database in Cloud Foundry.