How to Destroy all Dokku Apps

Dokku, the open source Platform as a Service (PaaS) alternative, allows developers to deploy arbitrary applications to a remote server in a Heroku-like way (i.e. using Git push).

You can list current applications on the server by running the Dokku CLI

ssh root@your_server_ip
dokku apps:list

=====> My Apps
# rails-1
# rails-2

What if you want to delete them all without having to individually confirm each application?

Drop this script into your server:

# Delete all Dokku Apps

dokku apps:list | tail -n +2 > apps.tmp
while IFS= read -r line
  dokku --force apps:destroy $line
done < apps.tmp

Be sure to make it executable and then run:


All apps will be destroyed without confirmation. Have fun!