Upgrading Old Versions of Dokku

Samuel O'Daniels
2 min readMay 31, 2023

--

Hi there. I originally planned to include this set of instructions as part of another article, but it was getting long. So I decided to make it into its own post. That said, let’s jump right in.

If Dokku was automatically included for you through the Digital Ocean (DO) 1-Click Droplet, chances are you’re running an inexcusably old version of the tool; version 0.21.4 specifically. It works fine for the most part, but there have since been dozens of releases with numerous improvements. The one improvement I'm particularly interested in is Cron support, because Dokku's Let's Encrypt plugin needs it to schedule cronjobs (tasks) for automatically renewing SSL certificates.

I spoke with the project’s maintainer, and he submitted a PR to update DO’s Droplet to use the latest version (0.30.6). He's also interested in automating the releases, so this shouldn't be an issue in the future. But in the meantime, we'll have to upgrade our versions ourselves.

Confirm The Version You’ve Got Installed

The upgrade path is dependent on the current version. Check it by running the following:

# on your dokku host
dokku version

If it’s below 0.25.x, you'll have to first upgrade to 0.29.x before 0.30.x to avoid a breaking change. Conversely, you can go straight to the latest if you have a higher version.

Upgrade to Version 0.29.4

Stop all your running apps first using:

# on your dokku host
# for 0.22.0 and newer versions, use
dokku ps:stop --all
# for versions between 0.11.4 and 0.21.4, use
dokku ps:stopall
# for versions between 0.8.1 and 0.11.3, use
dokku --quiet apps:list | xargs -L1 dokku ps:stop
# for versions versions older than 0.8.1, use
dokku --quiet apps | xargs -L1 dokku ps:stop

Then run these two commands to upgrade.

# on your dokku host
# run the three commands one after the other
rm bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.29.4/bootstrap.sh
sudo DOKKU_TAG=v0.29.4 bash bootstrap.sh

Upgrade to Version 0.30.6

Next, we’ll upgrade to the latest version at the time of writing this article.

# on your dokku host
# run the three commands one after the other
rm bootstrap.sh
wget -NP . https://dokku.com/install/v0.30.6/bootstrap.sh
sudo DOKKU_TAG=v0.30.6 bash bootstrap.shå

Confirm the new version by running dokku version

Restart Apps

# on your dokku host
dokku ps:start --all

That’s it. You’re now on the latest version. If you visit this page in the future, you can find all the latest releases and their respective upgrade commands here.

Thanks for reading. Till next time!

--

--

Samuel O'Daniels
Samuel O'Daniels

Written by Samuel O'Daniels

I’m an early-career Ruby on Rails developer looking to share the cool things I learn