Mental Pivot

Notes and observations from a lifelong pursuit of learning.

Insights and interesting reads delivered straight to your inbox.
Sign up for the free Mental Pivot Newsletter.

How to Update Ghost Blog Software on DigitalOcean

The following are my reference notes for how to keep my Ghost installation up-to-date. Note that these steps are targeted for “noobs” not experts.

Updating a Ghost blog installation with a hosting solution like DigitalOcean has been painless so far. Here are the steps I take to make sure my Ghost installation is up-to-date.

First step is to make sure your Ghost installation is current. There are several ways to accomplish this:

  1. Via web browser: Go to your Ghost admin panel, open your user account menu (lower left corner of the screen on a desktop browser), click on “About Ghost”. If there is an update available, the page that loads will inform you.
  2. Via Command Line Interface (CLI): Enter this command:
    ghost check-update
  3. If you want to check your current version from the CLI type:
    ghost version

You can also view the status of the Ghost Core at these two pages:

Important: Before you update Ghost, make sure you have backed up your site and you’re content. Backups are beyond the scope of this article, but one easy way to backup your content is via the “Export your Content” feature which can be found in the web admin panel under the “Labs” section. This will backup your settings and posts (but does not backup themes or images).

To update Ghost from the CLI on DigitalOcean:

  • Open your terminal app
  • At the command prompt type:
    ssh root@[yourdomain]
  • Enter your root password when prompted
  • Switch to ghost-mgr user as directed by Digital Ocean
    sudo -i -u ghost-mgr
  • Navigate to the Ghost installation location:
    cd /var/www/ghost
  • Run ghost update command:
    ghost update

All should go well, but a couple of problems I’ve run into:

  • If there is an error with installation, the output from the program will give you instructions on what you need to do. Do not ignore these instructions
  • Example: If Ghost Manager is out of date, you will want to update that and then run ghost update again. To update Ghost Manager, type:
    sudo npm install -g ghost-cli@latest
  • Example: If there are files or directories with incorrect permissions, you may need to run a “chmod” command. For instance, once the error message told me to run this command before running "ghost update":
    sudo find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \;”

Lastly, Ghost’s Documentation is excellent. Here are a few reference links if the above isn’t working for you:

Get weekly email updates and additional content: Sign up for the free Mental Pivot Newsletter.