RfC: How to update your Ghost CMS correctly

RfC: How to update your Ghost CMS correctly
Photo by Clint Patterson / Unsplash

Introduction

Once you run your self-hosted Ghost CMS installation, there will come a time when you have to update it to a new minor or major version. But that is being made more difficult since the official Developer documentation for the update process, here, misses some important steps.

So today, I will demonstrate with this RfC, what the correct and complete process of updating your Ghost CMS installation looks like.


Content of RfC

The developer documentation page talks about three important commands:

  • ghost check-update tells you if your installation has an update available
  • ghost backup creates a backup file which contains everything important about your Ghost CMS installation
  • ghost update actually runs through the update process

The steps guide that will follow contains all of these commands but with other added instructions in between that are missing from the official docs and are heavily recommended for everyone.

Let's start!

💡
This guide will demonstrate the process based on Ubuntu commands. Please substitute the directives in steps 2 and 6 with the correct variants fitting for your operating system.
  1. Log in to your server through SSH with your non-root user, that has sudo permissions
  2. Having an up-to-date OS is beneficial before touching Ghost itself, so run sudo apt update and sudo apt upgrade. If updates had to be installed, reboot the server with sudo reboot
  3. When you installed Ghost you selected and gave a site name. With this name in mind, navigate to the CMS install folder with cd /var/www/site-name/
  4. In there, we will now create a fresh backup in case anything goes wrong during the upgrade and you have to reinstall Ghost. We achieve that with ghost backup
  5. After that step is done, check the existence of the file with ll
  6. If everything is alright, we will create a virtual session to protect the upgrade process from an SSH disconnect. This step needs tmux, if this isn't installed on your OS, install it with sudo apt install tmux, and then call it with tmux
  7. Now we will check if the Ghost-CLI is up-to-date, so execute sudo npm install -g ghost-cli@latest
  8. After that command, we can now start the actual update process, so call ghost update
  9. Once the update itself finishes, I recommend also executing ghost doctor to check for any defects that were caused by the update
  10. If everything is fine there as well, let's reboot the server once more, so, close the tmux session with Ctrl+D and then send sudo reboot
  11. After your server is booted once more, you can enjoy your freshly updated Ghost CMS installation

💡
Our content is reader-supported. This means if you click on some of our links, then we may earn a commission.
You don't pay any extra for the usage of these links.
Thank you for supporting the author and this blog!