Skip to main content

How to update Ghost 3.x on Ubuntu 18.04 LTS

Introduction

My Ghost blog that was set up by the DigitalOcean 1-click installation failed to update a few times in 2019-2020. I was able to revert the failure using a backup image of my server.

Here is how to update and make sure that it will not fail. Follow these instructions as root or with sudo. The key is to have all the correct dependencies installed and up-to-date.

Backup

Before updating your Ghost blog, it is a good idea to download backups of your content. Visit your Ghost Admin > Labs > Export Content. You may also want to download your image and theme directory using SFTP.

Check Dependencies

  1. Check your Node version:
    node -v
  2. If your Node version is not v12.x.x (Node v12 Erbium LTS), follow the instructions to upgrade Node.

Steps

  1. Update the Ubuntu dependencies:
    sudo apt-get update && sudo apt-get dist-upgrade -y
  2. Update npm:
    sudo npm install -g npm@latest
  3. Update the Ghost-cli:
    sudo npm install -g ghost-cli@latest
  4. Change user to ghost-mgr:
    sudo -i -u ghost-mgr
  5. Change directory to Ghost installation:
    cd /var/www/ghost
  6. Run ghost doctor and fix anything that needs to be fixed:
    ghost doctor
  7. Update Ghost:
    ghost update