Last updated May 05, 2023
Table of Contents
A stack is an operating system image that is 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 an app’s source code into an executable package that is compatible with that stack.
Stack Support Details
|Ubuntu 22.04 LTS
|Ubuntu 20.04 LTS
|Ubuntu 18.04 LTS
|Ubuntu 16.04 LTS
¹: Container based apps don’t include the curated and maintained operating system layer of the other Heroku stacks. You’re responsible for selecting and maintaining the base layer of containers you deploy.
Every stack on Heroku supports different operating system packages and language runtime versions. This support is typically confined to software that was still actively developed by the respective maintainers at the time the stack was first released.
Ubuntu Packages on Heroku Stacks lists packages available on each stack.
Our Stack Update Policy describes when and how we update or retire existing stacks and our schedule for introducing new stacks.
The default stack for all newly created Heroku apps is Heroku-22.
Viewing which stack your app is using
You can determine which stack your app is using with the
heroku stack CLI command:
$ heroku stack
=== ⬢ example-app Available Stacks
In the example above, the
heroku-20 stack is active, and the other listed stacks are available as alternatives.
Migrating to a New Stack
You can change the stack your app uses for the next deploy using
$ heroku stack:set heroku-22
You might need to make code changes when you move an app to a different stack. For detailed instructions on upgrading the stack of an app, refer to the upgrading to the latest stack instructions.