What is the proper command to restart a Dokku app from SSH?
Asked Answered
P

5

59

A Rails app I deployed on DigitalOcean using Dokku crashed and started returning 500 errors.

How can I restart it without pushing an empty commit?

Pax answered 21/1, 2014 at 0:56 Comment(0)
P
97

dokku ps:restart <app> works for me logged in with dokku system user.

Use dokku apps:list to list your apps.

Panzer answered 12/3, 2015 at 23:1 Comment(1)
This worked for me, and seems official, as of 2016-12-22. I found my domain returning 502's (Bad Gateway) because my app was down.Essence
D
31

If you just want restart the web app, run dokku deploy myapp

Dictum answered 24/6, 2014 at 17:23 Comment(0)
P
24

Found it there! You have to use Docker restart command directly.

Connect to your server by SSH and run:

docker restart `cat /home/dokku/myapp/CONTAINER`

myapp being the name of my application. Change the path to your app if needed.

Pax answered 21/1, 2014 at 0:56 Comment(4)
Atleast from v. 0.3.15 onwards you can run dokku help to see all available dokku commands.Neoplasm
dokku ps:restart APP would be the proper way to do this now.Lotz
I found this to cause trouble with dokku. It doesn't expect you to have gone behind its back and restart directly with docker.Albumin
thanks @Albumin there is now an way to do it in dokku directly, I changed the accepted answerPax
R
12

The proper way to restart an app is:

dokku release myapp
dokku deploy myapp

This is how it's done in plugins/config/commands after setting environment variables:

config_restart_app() {
  APP="$1";

  echo "-----> Releasing $APP ..."
  dokku release $APP
  echo "-----> Release complete!"
  echo "-----> Deploying $APP ..."
  dokku deploy $APP
  echo "-----> Deploy complete!"
}

I have sent a pull request to add a dokku restart myapp command.

Ramires answered 12/8, 2014 at 7:50 Comment(0)
S
5

EDIT

The 'new' way appears to be to issue the command 'dokku ps:restart myapp'

END EDIT

An easier way might be to use a plugin:

https://github.com/scottatron/dokku-rebuild

Then issue

dokku rebuild myapp

Sicken answered 10/9, 2014 at 4:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.