5

I have a staging server hosted on heroku, I just want to bring it down, but not destroy the app. How can I do it? Do I have any command like 'heroku stop' like 'heroku restart' for restarting?

OR

Is there a way to automate the server to turn off itself when it exceeds the 750 hr free usage?

Actually I don't want the server so I am trying to stop it, or leave it for the free hours.

n00b
  • 721
  • 1
  • 7
  • 18

4 Answers4

7

You can scale individual non-web processes down to zero quite happily:

$ heroku ps:scale worker=0
$ heroku ps:scale resque=0
etc...

and web to 1:

$ heroku ps:scale web=1

As Mischa says, you get one free dyno running, so leave your 1 web dyno running (I'm not sure you can stop the last web process)

Neil Middleton
  • 22,105
  • 18
  • 80
  • 134
4

You can put it under maintenance, which stops it but doesn't delete it:

heroku maintenance:on

More info: https://devcenter.heroku.com/articles/maintenance-mode

Daniel Morris
  • 6,852
  • 8
  • 25
  • 30
bbonamin
  • 30,042
  • 7
  • 40
  • 49
  • Not sure if this exactly helps. From their page `"Enabling or disabling maintenance mode generally doesn’t alter running dynos. Web dynos continue to run as before"` – domino Aug 11 '12 at 15:33
3

Login to the account, and click on the resource and then bring down the dyno count to 0 and the save. Now you can check by trying to open the site. It will be down.

n00b
  • 721
  • 1
  • 7
  • 18
1

Easily disable/enable the App by going to your Heroku dashboard ==> resource tab the rest is on the picture below:

enter image description here

Davoud
  • 2,576
  • 1
  • 32
  • 53