Activates/Deactivates an app running on the PaaS Heroku without to waste free dynos in one go.

Usage no npm install needed!

<script type="module">
  import herokuDeactivator from 'https://cdn.skypack.dev/heroku-deactivator';


What is it about

Activates/Deactivates the app running on the PaaS Heroku in one go.


  1. HerokuSwitch is working with the official Heroku CLI, install it: npm i -g heroku
  2. Then install HerokuSwitch using NPM: npm i herokuswitch --save
  3. Go to the app's folder in node_modules and open herokuswitch.js
  4. Configure the following object:
// CONFIGURATION (must edit)
const cfg = {
    app: '', // insert your app's name here (Ex. 'myApp')
    resource: '' // choose your process resource type ('Worker' or 'web' )


Open the terminal. The syntax is: node herokuswitch -<option>

Choose an option to execute it. Example: node herokuswitch -off

This turns off the app completely by turning on maintenance mode and deactivates the process resource type in one go.


-off Turns off the app on Heroku by turning on maintenance mode and process resource type off.

-on Turns the app on again by turning the maintenance mode off and enables the specific resource type defined in the configuration, see installation.

-log Displays the log of the app in a new terminal window.

-restart Restarts the app on Heroku.

-dynos Looks up the remaining dynos and used up resources.

-update Updates the Heroku CLI (Heroku module required)

If you encounter any errors, don't hesitate to open up an issue, thank you!