Heroku-16 Stack
Last updated August 02, 2024
Table of Contents
The Heroku-16 stack reached end-of-life on May 1st, 2021. Please upgrade to a newer stack as soon as possible. See the Heroku-16 End-Of-Life FAQ for more details.
This article describes the Heroku-16 stack, based on Ubuntu 16.04. What is a stack?
What’s new
We’ve made the following changes from the Cedar-14 stack to the Heroku-16 stack:
- Heroku-16 is much smaller, with a Docker image of 465 MB (vs 1.35 GB for Cedar-14). By using the Heroku-16 Docker image for local development, you ensure dev/prod parity (i.e., the image running locally, is the same image running on Heroku).
- Improved support for compiling native Ruby and Python packages
- The JDK is installed by the Java/JVM buildpack. If you have an app that uses Java, but not the Java buildpack (e.g., jython or a Java Bridge), you’ll have to set the JVM buildpack on your app (instructions are listed below).
- The
HEROKU_
namespace is reserved for config vars set by the Heroku platform in order to offer functionality. If you have createdHEROKU_
config vars, we suggest you change them when upgrading to Heroku-16, in order to avoid config var conflicts.
Available software
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.
Language runtimes
For the most accurate information on supported language runtime versions, please check the individual language pages:
Buildpack | Shorthand | Runtime versions |
---|---|---|
Ruby | heroku/ruby |
Runtime versions |
Node.js | heroku/nodejs |
Runtime versions |
Python | heroku/python |
Runtime versions |
Java | heroku/java |
Runtime versions |
PHP | heroku/php |
Runtime versions |
Go | heroku/go |
Runtime versions |
Operating system packages
For a full list of operating system packages available on Heroku-16, please refer to article Ubuntu Packages on Heroku Stacks.
Support period
Heroku-16 is based on Ubuntu 16.04, and so reached end-of-life on May 1st, 2021. See the Heroku-16 End-Of-Life FAQ for more details.
Using Heroku-16
It is no longer possible to create new Heroku-16 apps, or to switch an existing app’s stack to Heroku-16. Please use a supported stack instead.
Upgrading to Heroku-16
Please refer to the stack upgrading guide to understand the procedures to follow when upgrading to a new stack.
We recommend that you monitor your application closely after migrating an app to the new stack to ensure it’s performing correctly.
Upgrade notes
Java is no longer part of the stack
If you are running an app that requires the JVM, but does not use the Java buildback (e.g., jython or a Java Bridge), you will need to set heroku/jvm
as your first buildpack, because the Heroku-16 stack no longer bundles a JDK.
The JVM buildpack will then run as the first step of your builds, making the JDK available to subsequent buildpacks and at runtime.
On the command line, prepend heroku/jvm
to your heroku-16 app’s list of buildpacks:
$ heroku buildpacks:add --index 1 heroku/jvm
To review your app’s new list of buildpacks, use heroku buildpacks
:
$ heroku buildpacks
=== my-app-on-heroku-16 Buildpack URLs
1. heroku/jvm
2. heroku/python
If you are using app.json
, you can instead prepend heroku/jvm
to the list of buildpacks there:
{
"buildpacks": [
{
"url": "heroku/jvm"
},
{
"url": "heroku/ruby"
}
]
}
Locales are no longer part of the stack
Locales are instruction sets used by some programs to perform operations such as number formatting, string collation or date representation according to a language and/or region.
Starting with Heroku-16, locales are no longer part of the stack, and instead installed via a separate buildpack.
If your app requires locales, create a .locales
file in the root directory of your app’s codebase that lists all the locales you need. For example:
de_DE
fr_FR
After you have git add
ed the .locale
file and git commit
ted the change, you may then prepend the heroku-community/locale
buildpack to the list of buildpacks used by your app:
$ heroku buildpacks:add --index 1 heroku-community/locale
The heroku-community/locale
buildpack will then run as the first step of your builds, and install the desired locales for use by subsequent buildpacks and at runtime.
For Java applications, support for locale-specific behavior in the java.util
and java.text
packages is platform independent, so an installation of system locales is typically not necessary. The system locale and time zone are only used for setting the initial default locale and time zone based on the host operating system’s locale and time zone; any changes to and uses of other locales and time zones use data that is bundled with the JVM.
Heroku-16 Docker image
Heroku-16 is available as two Docker images:
- The runtime image (
heroku/heroku:16
), which is recommended over the build image for most workloads. - The build image (
heroku/heroku:16-build
), which is larger as it includes development headers and toolchains. It is only recommended for customers that need to compile source code or dependencies.
Use the following command in your Dockerfile
to use Heroku-16 as your base image:
FROM heroku/heroku:16
To learn more about deploying Docker images, please refer to the Heroku Container Registry and Runtime documentation.