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
      • Node.js Behavior in Heroku
      • Troubleshooting Node.js Apps
    • 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
    • Heroku Inference
      • Inference Essentials
      • AI Models
      • Inference API
      • Quick Start Guides
    • Working with AI
  • 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
  • Heroku App Lifecycle

Heroku App Lifecycle

Last updated April 16, 2025

Table of Contents

  • 1. Develop the App
  • 2. Push Code to Heroku
  • 3. Build the App
  • 4. Deploy the Release
  • 5. Run the App
  • 6. Scale the Resources
  • 7. Monitor the App
  • 8. Update and Maintain the App
  • 9. Optimize Your Resources
  • 10. Decommission the App
  • Next Steps

Heroku is a cloud platform that allows developers to deploy, manage, and scale applications effortlessly. It abstracts away much of the complexity involved in infrastructure management. To effectively use Heroku, it’s crucial to understand its app lifecycle. The lifecycle consists of several distinct stages that an app undergoes from development to deployment and beyond.

1. Develop the App

During the development phase, write the code and create an empty app on Heroku to deploy to it.

You must also prepare the app for deployment. While you don’t need to make many changes to run your app on Heroku, you must tell the platform which parts of your app are runnable.

If you use common language idioms or frameworks, Heroku can figure it out. For example, in Node.js it’s the main field in package.json. For other apps, or to declare multiple process types to execute, you must declare them in a text file called a Procfile.

Other common practices during development include integrating dependencies, installing add-ons for backing services like databases, and running apps locally.

2. Push Code to Heroku

The complete deployment process consists of pushing your code, which triggers a build, that then gets deployed in the form of a release to run on the Heroku platform.

Heroku simplifies the deployment process through Git-based deployment and CI/CD integrations. How you push code depends on your method of deployment, with git push heroku main and the GitHub integration being the most popular.

3. Build the App

When the Heroku platform receives the source code, it initiates a build of the source app.

Heroku supports multiple buildpacks, which help configure the environment and dependencies for different languages, such as Node.js, Python, Ruby, and Java. For most apps, we automatically detect which buildpack to use.

The build mechanism is typically language-specific, but it follows the same pattern. It typically retrieves the specified dependencies and creates any necessary assets, such as processing style sheets or compiling code. The resulting build artifact contains your compiled, assembled app that is ready to run, and the instructions, the Procfile, of what you want to execute.

When performing a build for Fir-generation apps, we maintain a copy of the app source code solely for the purpose of facilitating user deployments. This copy updates with each build to reflect the most recent version.

4. Deploy the Release

A successful app build triggers the creation of a new release. Before creating the new release, Heroku runs any tasks that are specified in the release phase, if applicable.

If you have a successful app build, and all applicable release phase tasks run successfully, Heroku deploys the release. If you use Heroku CI or other CI/CD integration tools, you can require that your test run pass before deployment. Beyond pushing code, Heroku also creates a new release and restarts your app if you change a config var, or modify your app’s add-on resources.

Your release deploys to all app dynos, with Heroku’s Preboot and Rolling Deploys features enabling zero downtime deployments. To test your app thoroughly before making changes to production, consider using the Review Apps and Pipelines features to promote builds instead.

5. Run the App

By default, apps are accessible at their Heroku domains.

After deployment, the app enters the runtime phase, where it runs on compute resources called dynos that actively serve requests. Depending on your dyno formation, some of your dynos run the command associated with the web process type, and some run other commands as declared in your Procfile.

The web dynos are the only ones that receive HTTP traffic. Heroku’s HTTP routers distribute incoming requests for your app across your running web dynos. This routing handles both HTTP and HTTPS traffic, and it supports multiple simultaneous connections and timeout handling.

The dyno manager is a part of the platform responsible for running dynos. Its jobs include cycling, or restarting, dynos when it detects a fault in the running app or problems with the underlying hardware. It also cycles dynos on a daily basis to help maintain the health of apps, unless configured otherwise.

6. Scale the Resources

Scaling an app’s capacity to handle web traffic generally involves scaling the number of web dynos. You can also scale up other process types, such as worker dynos for handling your background jobs.

Heroku offers a robust scaling model with multiple dyno sizes so you can adjust resources as needed:

  • Horizontal scaling: Adding more dynos to handle increased traffic.
  • Vertical scaling: Changing to different sized dynos.

7. Monitor the App

To ensure the app runs smoothly, monitor its performance and debug issues when necessary. Heroku provides various monitoring tools, such as logs, metrics, OpenTelemetry (for Fir-generation apps only), and support for monitoring add-ons.

8. Update and Maintain the App

Apps require regular updates for bug fixes, security patches, and new features. Because Heroku manages and runs apps, the platform takes care of platform updates and maintenance as well as maintenance for Heroku’s own add-ons, like Heroku Postgres.

Beyond the updates and maintenance provided by Heroku, you can also make any changes you need to your codebase and enter maintenance mode if you must temporarily disable access to your app. You can also run one-off dynos to carry out admin tasks.

9. Optimize Your Resources

As you scale, monitor and update your app, find ways to optimize your code and resource usage. See tips on how to optimize your usage in this guide.

10. Decommission the App

When you no longer need an app, scale it down, remove its add-ons, and delete it from Heroku. Deleting an app is permanent and removes all associated data such as configuration, code, builds and releases with it.

Next Steps

Understanding Heroku’s app lifecycle helps developers make the most of the platform’s features for efficient deployment, scaling, and management. By leveraging Heroku’s streamlined workflow, teams can focus on building and improving their apps without worrying about complex infrastructure management. Dive deeper into any of these topics to learn more:

  • Getting Started Guides
  • Running Apps Locally
  • Prepare a Codebase for Deployment
  • Buildpacks
  • Deployment
  • Releases and Release Phase
  • Scaling Your Dyno Formation
  • Monitoring Heroku Apps
  • Optimizing Resource Costs

Keep reading

  • Heroku Architecture

Feedback

Log in to submit feedback.

The Procfile Heroku Generations

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