Changing Stacks

Page last updated:

Warning: Pivotal Cloud Foundry (PCF) v2.4 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.

Page last updated:

This topic explains how to restage apps on a new stack. It also provides a description of stacks and lists the supported stacks on Pivotal Application Service (PAS) v2.4.

You can also use the Stack Auditor plugin for the Cloud Foundry Command Line Interface (cf CLI) when changing stacks. See Using the Stack Auditor Plugin.


A stack is a prebuilt root file system (rootfs) that supports a specific operating system. For example, Linux-based systems need /usr and /bin directories at their root. The stack works in tandem with a buildpack to support apps running in compartments. Under Diego architecture, cell VMs can support multiple stacks.

Note: Docker apps do not use stacks.

Available Stacks

PAS v2.4 includes support for the following stacks:

  • cflinuxfs3: The Linux cflinuxfs3 stack is derived from Ubuntu Bionic 18.04. For more information about supported libraries, see the GitHub stacks page.
  • cflinuxfs2: The Linux cflinuxfs2 stack is derived from Ubuntu Trusty 14.04. For more information about supported libraries, see the GitHub stacks page.

    Breaking Change: Support for Ubuntu Trusty 14.04 ends in April 2019. Future versions of PAS may remove support for cflinuxfs2. Push all new apps using cflinuxfs3 and migrate existing apps to cflinuxfs3 as soon as possible. For more information about the Ubuntu support lifecycle, see the Canonical documentation.

Restaging Apps on a New Stack

For security, stacks receive regular updates to address Common Vulnerabilities and Exposures (CVEs). Apps pick up on these stack changes through new releases of PAS. However, if your app links statically to a library provided in the rootfs, you may have to manually restage it to pick up the changes.

It can be difficult to know what libraries an app statically links to, and it depends on the languages you are using. One example is an app that uses a Ruby or Python binary, and links out to part of the C standard library. If the C library requires an update, you may need to recompile the app and restage it as follows:

  1. Run cf stacks to list the stacks available in a deployment.

    $ cf stacks
    Getting stacks in org MY-ORG / space development as
    name            description
    cflinuxfs2      Cloud Foundry Linux-based filesystem - Ubuntu Trusty 14.04 LTS
    cflinuxfs3      Cloud Foundry Linux-based filesystem - Ubuntu Bionic 18.04 LTS
  2. To change your stack and restage your app, run cf push. For example, to restage your app on the stack cflinuxfs3, run cf push MY-APP -s cflinuxfs3:

    $ cf push MY-APP -s cflinuxfs3
    Using stack cflinuxfs3...
    Creating app MY-APP in org MY-ORG / space development as
    requested state: started
    instances: 1/1
    usage: 1G x 1 instances
    last uploaded: Wed Apr 8 23:40:57 UTC 2015
        state    since                    cpu    memory        disk
    #0  running  2015-04-08 04:41:54 PM   0.0%   57.3M of 1G   128.8M of 1G

    To specify a different stack, replace cflinuxfs3 with the name of the stack in the -s STACKNAME parameter of the command.

Stacks API

For API information, see the Stacks section of the Cloud Foundry API Documentation.