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
      • Troubleshooting Node.js Apps
      • Working with Node.js
      • 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
      • Working with PHP
      • PHP Behavior in Heroku
    • 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
    • Working with AI
    • Heroku Inference
      • Inference API
      • Quick Start Guides
      • Inference Essentials
      • AI Models
    • Vector Database
    • Model Context Protocol
  • 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
  • Continuous Delivery & Integration (Heroku Flow)
  • Maintenance Mode

Maintenance Mode

English — 日本語に切り替える

Last updated February 12, 2025

Table of Contents

  • Usage
  • Maintenance mode and dynos
  • Customizing your maintenance page

If you need to temporarily disable access to your Heroku app (for example, to perform a large migration), you can enable Heroku’s built-in maintenance mode. While in maintenance mode, your app serves a static maintenance page to all visitors.

While maintenance mode is active, the error code H80 is returned in your logs.

Scheduler jobs can still run while your app is in maintenance mode. Be mindful if you have any jobs set to run.

 

Maintenance mode is not yet available for Fir-generation apps. Subscribe to our changelog to stay informed of when we add this feature to Fir.

Usage

To enable maintenance mode:

$ heroku maintenance:on
Enabling maintenance mode for myapp... done

To disable maintenance mode:

$ heroku maintenance:off
Disabling maintenance mode for myapp... done

To check the current maintenance status of an app:

$ heroku maintenance
off

Maintenance mode and dynos

Enabling or disabling maintenance mode does not alter your app’s dyno formation. Dynos continue to accrue billing hours while in maintenance mode. Web dynos continue to run, but Heroku’s routers block all incoming HTTP requests to them. Dynos of other types (such as worker dynos) also continue to run, and you can run one-off dynos as usual.

Scaling dynos in maintenance mode

It can be useful to scale your app’s dynos to zero during maintenance operations. For example, doing so can prevent database transactions from taking place.

First, enable maintenance mode:

$ heroku maintenance:on
Enabling maintenance mode for myapp... done

Check the current dyno formation, so you know what values to restore after maintenance, and then scale your dynos to zero:

$ heroku ps
web=3:Private-M worker=2:Private-M
$ heroku ps:scale worker=0
Scaling worker processes... done, now running 0

You can do the same for any of an app’s process types, such as web.

Avoid scaling web=0 in Private Spaces. Doing so causes app response errors instead of serving the maintenance page, because the routing proxy in spaces resides on the web dynos’ compute instances.

You can run one-off dynos to perform maintenance activities or check the app’s health after database upgrades.

$ heroku run bash

After maintenance activities complete, scale the dynos up:

$ heroku ps:scale worker=2
Scaling worker processes... done, now running 2

Disable maintenance mode:

$ heroku maintenance:off
Disabling maintenance mode for myapp... done

Customizing your maintenance page

You can specify a custom maintenance page for your app by setting the following config var:

heroku config:set MAINTENANCE_PAGE_URL=//s3.amazonaws.com/<your_bucket>/your_maintenance_page.html

Please see this article for more information.

Keep reading

  • Continuous Delivery & Integration (Heroku Flow)

Feedback

Log in to submit feedback.

Releases Managing Multiple Environments for an App

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