Last updated 21 December 2016
A stack is an operating system image curated and maintained by Heroku. Stacks are typically based on an existing open source Linux distribution such as Ubuntu. Heroku applications target a specific stack and buildpacks are responsible for transforming the app’s source code into an executable package built specifically for that stack.
There are two current stacks: the Cedar-14 stack and the legacy ‘Cedar’ stack.
Heroku’s officially supported buildpacks work with all current stacks. Custom buildpacks are not guaranteed to work with all stacks.
The default for all apps on Heroku is the Cedar-14 stack.
The only stacks currently available are the “Cedar” stacks. The current Cedar stacks comes in two flavors. The versions signify the base technology on which they’re built.
|Stack Version||Base Technology|
|cedar (deprecated)||Ubuntu 10.04|
Ubuntu Packages on Heroku Stacks lists packages available on each stack.
Viewing which stack your app is using
The stack your app is using can be determined using the
heroku apps:info CLI command.
$ heroku apps:info -a example === example ... Stack: cedar-14 ...
Migrating to a new stack
The available stacks for existing apps can be determined using the
stack CLI command.
$ heroku stack
You might need to make changes to your application code when you move an app to a different stack. The
stack:set command will tell Heroku what stack to use, but it is your responsibility, as the application developer, to make any required changes to your code.
When migrating a production app to a new stack, you should perform the migration work on a staging version of the app in a separate code branch. After you have tested that the app runs correctly on the new stack, you can merge in your changes on the production environment, change the stack with
stack:set and deploy. This process is described in detail in Migrating to the Celadon Cedar-14 Stack.