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
  • 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
View 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
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Rails Support
      • Working with Bundler
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • 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
  • Maintenance Mode

Maintenance Mode

English — 日本語に切り替える

Last updated May 07, 2024

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.

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

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

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
  • heroku.com
  • Terms of Service
  • Privacy (日本語)
  • Cookies
  • Cookie Preferences
  • Your Privacy Choices
  • © 2024 Salesforce.com