5
votes

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.

4
24*31=744, so as long as you have 1 web dyno it'll always be free. No need to stop it. - Mischa
I have rake tasks, scheduler mailers, crons etc, so It exceeds 750.. Also few rake tasks are running like 5 hours or so which is supposed to be ended in 10 mins.. - n00b
The pricing page implies you can set the number of web dynos to 0. - Eden Townsend
You can always put something irrelevant in the Procfile so it doesn't launch your rails app/workers/crons, etc.. or enable the maintenance mode - fuzzyalej

4 Answers

6
votes

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)

4
votes

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

3
votes

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.

1
votes

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

enter image description here