Skip Navigation
Show nav
Heroku 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
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • 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 Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • 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
  • Maintenance Mode

Maintenance Mode

English — 日本語に切り替える

Last updated March 09, 2020

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.

You can enter maintenance mode and scale your web dynos to zero like so:

$ heroku maintenance:on
Enabling maintenance mode for myapp... done
$ heroku ps:scale web=0
Scaling web processes... done, now running 0

You can do the same for your app’s other process types, such as worker.

If you scale down dynos while in maintenance mode, make sure to scale them back up before restoring traffic to your app!

If you scale your app’s web dynos to zero, maintenance mode’s behavior differs depending on whether your app runs in the Common Runtime or in a Private Space:

  • In the Common Runtime, your maintenance page continues to be served, because it is served by a shared routing cluster.
  • In a Private Space, the maintenance page is not served, because it is served by a routing proxy that resides on the same compute instances as your web dynos.

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

Feedback

Log in to submit feedback.

Review Apps (Old) Managing Multiple Environments for an App

Information & Support

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

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences