Stacks
Last updated October 23, 2024
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.
Heroku currently provides three stacks as the base layer an app runs on: Heroku-20, Heroku-22 and Heroku-24.
Stack Support Details
Stack Version | Base Technology | Available since | Supported through | Status |
---|---|---|---|---|
Heroku-24 | Ubuntu 24.04 LTS | 2024 | April 2029 | Default stack |
Heroku-22 | Ubuntu 22.04 LTS | 2022 | April 2027 | Supported |
Heroku-20 | Ubuntu 20.04 LTS | 2020 | April 2025 | Deprecated |
Heroku-18 | Ubuntu 18.04 LTS | 2018 | April 2023 | End-of-life |
Heroku-16 | Ubuntu 16.04 LTS | 2017 | April 2021 | End-of-life |
Container | Docker | 2017 | N/A¹ | N/A¹ |
¹: 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.
Heroku’s officially supported buildpacks work with all supported stacks. Third-party buildpacks aren’t guaranteed to work with all stacks.
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.
Default Stack
The default stack for all newly created Heroku apps is Heroku-24.
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
container
heroku-20
heroku-22
* heroku-24
In the example above, the heroku-24
stack is active, and the other listed stacks are available as alternatives.
Migrating to a Different Stack
You can change the stack your app uses for the next deploy using heroku stack:set
:
$ 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.