Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Model Context Protocol
    • Vector Database
    • Working with AI
    • Heroku Inference
      • Quick Start Guides
      • AI Models
      • Inference Essentials
      • Inference API
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Heroku Architecture
  • Buildpacks

Buildpacks

English — 日本語に切り替える

Last updated April 03, 2025

Table of Contents

  • Classic Buildpacks
  • Cloud Native Buildpacks
  • Supported Buildpacks
  • Third-Party Buildpacks
  • Buildpack Auto-Detection
  • Buildpack Behavior
  • Managing Buildpacks
  • Creating a Buildpack
  • Troubleshooting
  • Limitations for Cloud Native Buildpacks
  • Additional Reading

Buildpacks are a set of scripts that transform code into a deployable artifact with minimal configuration that gets executed on a dyno. When you deploy your code, we automatically detect the correct buildpack to use for your app when possible.

Heroku implements its support for Ruby, Python, Java, Clojure, Node.js, Scala, Go, PHP, and .NET via a set of open-source buildpacks.

A typical buildpack performs operations like:

  • Inspect your source code to detect the programming language and version
  • Install programming language binaries
  • Install dependencies
  • Compile code
  • Build frontend assets
  • and more..

We maintain a collection of officially supported classic buildpacks for the Heroku Cedar generation of our platform, and Heroku Cloud Native Buildpacks for the Fir generation.

You can also deploy Docker images directly to Heroku Cedar instead of deploying code with git push.

Classic Buildpacks

In Cedar, the slug compiler assembles the output from classic buildpacks into an executable slug.

Alternatively, you can manually create and deploy a slug via the platform API instead.

You can’t use classic buildpacks in Fir.

With classic buildpacks, you set the version of Heroku’s base image, for example, heroku-24, with heroku stacks:set.

Cloud Native Buildpacks

In Fir, Heroku supports the use of Cloud Native Buildpacks (CNBs). CNBs build an Open Container Initiative (OCI) image from your code. CNBs are only available in Fir.

Cloud Native Buildpacks

See this short video introduction. For a deeper understanding of the concepts behind Cloud Native Buildpacks, see buildpacks.io’s official documentation.

Heroku Cloud Native Buildpacks

Heroku Cloud Native Buildpacks are CNBs designed to bring the same experience of our Cedar platform to Fir, and anywhere else that supports containers. Heroku CNBs produce a production-ready image for deployment to Heroku Fir.

All Fir-generation Heroku apps use CNBs by default. They are made available to Fir via the CNB builder, heroku/builder:24, which you can also use locally with the Pack CLI.

With CNBs, the version of the Heroku base image used depends on the builder. If you want to use a different builder and base image than the default, you can change your project.toml file.

The heroku stacks CLI command is for managing apps that use classic buildpacks. While the value for stack for classic buildpack apps is the version of its Heroku base image, for Cloud Native Buildpack apps, stack always equals cnb.

Compared to classic buildpacks, Heroku Cloud Native Buildpacks provide:

  • Support for arm64 CPU architectures
  • Compliance with open standards
  • Compatibility with cloud native tooling
  • Off-platform usability such as local build debugging and inspection

See Classic and Cloud Native Buildpacks Comparison.

Supported Buildpacks

Heroku maintains a collection of officially supported classic buildpacks and Heroku CNBs. See Officially Support Buildpacks for more info.

Third-Party Buildpacks

You can use custom buildpacks to support languages or frameworks not covered by Heroku’s officially supported buildpacks. See Using Third-Party Buildpacks for more info. Heroku doesn’t provide official support for custom buildpacks.

Buildpack Auto-Detection

When you deploy your code, we automatically detect the correct buildpack to use for your app when possible. Detection criteria depend on the language. For example, a Node buildpack looks for a package.json file.

For apps using classic buildpacks, if the build succeeds, the detected buildpack is permanently set for future pushes to your application as if you had manually set the buildpack.

For apps using CNBs, auto-detection happens each time you deploy, unless the buildpacks are explicitly specified via project.toml.

Detection Failures

While Heroku can normally detect which buildpack to use for your app, there are some common causes of detection failure:

  • Your app uses a language that isn’t supported by Heroku’s official buildpacks, such as Rust or Elixir.
  • Your app is missing a critical file, such as package.json for Node.js apps or go.mod for Go apps.

In these cases, you can manually set a buildpack.

Buildpack Behavior

See each of our supported language’s docs category for articles describing the behavior of each buildpack on our platform. You can also click on the GitHub links listed in Officially Supported Buildpacks to read more about the buildpacks in each repo.

Managing Buildpacks

For many apps, the auto-detected buildpack is all you need.

You can manually add and remove buildpacks for your app. See Managing Buildpacks for more info.

There are many scenarios where you need multiple buildpacks for an application. See Using Multiple Buildpacks for an App for instructions. Typical scenarios include database connection pooling using PgBouncer, or asset handling using a Node.js library in combination with a Ruby, Python or PHP application.

Creating a Buildpack

To use a language or framework not yet supported on Heroku you can create a custom buildpack.

To get started with classic buildpacks, learn about their structure in Buildpack API.

For info on creating your own Cloud Native Buildpack, see buildpacks.io official documentation.

Troubleshooting

See Troubleshooting Buildpack Errors.

Limitations for Cloud Native Buildpacks

App config vars are unavailable for CNB builds on Heroku Fir. Without these environment variables, avoid private dependency installation at build time. Either vendor private dependencies into the repo, or avoid private dependencies.

You can set environment variables in project.toml, but don’t use it for secrets. See Setting Config Vars for more information.

Additional Reading

  • Managing Buildpacks
  • Officially Supported Buildpacks
  • Classic and Cloud Native Buildpacks Comparison
  • Troubleshooting Buildpack Errors

Keep reading

  • Heroku Architecture

Feedback

Log in to submit feedback.

The Procfile Configuration and Config Vars

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices