How to update Ghost on Raspberry Pi

One of the great things about Ghost is that the team of developers are constantly working to improve it, or add new features. Not only that, but anybody can contribute to Ghost via their official GitHub repository - in fact, the author of this post (Wesley Archer - aka. raspberrycoulis) is an official contributor to Ghost having helped identify and fix an issue that prevented the installation of Ghost on low-power devices, such as the Raspberry Pi.

However, whenever the Ghost team publish a new release it means that you'll need to update your version of Ghost too - especially if you want to keep up-to-date with all the latest features and fixes. On a supported stack, this is not a major issue, but when you are running Ghost on a Raspberry Pi or ASUS Tinker Board, then this can be a problematic.


Updating Ghost on Raspberry Pi or ASUS Tinker Board

From a technical point of view, updating your Ghost blog if hosted on a Raspberry Pi or ASUS Tinker Board is a pretty straight forward process. However, there are some potential issues that can occur but thankfully there are ways to work around these.

Before making any changes to your Ghost blog, we always recommend you make a proper backup just in case things go wrong. You can easily do this from the labs section in the Ghost admin panel, but you can also create an image of your SD card too for a comprehensive backup. More information on how to achieve this can be found on our previous post.

Once you are ready, the process of updating is very straight forward. As always, the commands below are ran in the terminal once you have connected to your Pi via SSH.

boo@ghost-pi ~ $ cd /var/www/ghost
boo@ghost-pi ~ $ ghost stop

The two commands above will change directory to your Ghost installation, then will stop the Ghost blog that is running. On more powerful devices, this is not really required, but on a Raspberry Pi or ASUS Tinker Board, stopping your Ghost blog first can free up some valuable system resources.

Once the blog has been stopped, you can continue with the update process:

boo@ghost-pi ~ $ sudo npm i -g ghost-cli@latest

This command will ensure you are using the latest version of the Ghost Command Line Interface tool (Ghost-CLI), which is always useful. This can take a few minutes depending on your device, but you'll be returned to the command prompt when complete. Next:

boo@ghost-pi ~ $ ghost update

Assuming you are still in your Ghost installation directory, the above command will initiate the update process.

Again, on the Raspberry Pi this can take around 10 - 15 minutes, so be patient. You will know when it's complete when you are returned to the command line, along with several status messages in the terminal.

The update process will also restart your Ghost blog automatically, so you can check that everything is working by visiting your blog in your favourite browser, or you can run:

boo@ghost-pi ~ $ ghost ls
Running sudo command: systemctl is-active ghost_ghostpi-pro
┌───────────────┬────────────────────────┬─────────┬──────────────────────┬──────────────────────┬──────┬─────────────────┐
│ Name          │ Location               │ Version │ Status               │ URL                  │ Port │ Process Manager │
├───────────────┼────────────────────────┼─────────┼──────────────────────┼──────────────────────┼──────┼─────────────────┤
│ ghostpi-pro   │ /var/www/ghost         │ 2.0.3   │ running (production) │ https://ghostpi.pro  │ 2368 │ systemd         │
└───────────────┴────────────────────────┴─────────┴──────────────────────┴──────────────────────┴──────┴─────────────────┘
boo@ghost-pi ~ $

This command lists all the Ghost blogs running and shows you important information about them, such as the installation directory, the version (in our case version 2.0.3 is the latest at the time of writing), whether the blog is running or not, the URL used to access your blog, the port in use and the process manager controlling it.


Ghost update problems on Raspberry Pi

Sometimes things do go wrong, and it can be very frustrating when they do (believe us!). If you have been following the guides on Ghost Pi, then hopefully everything is running smoothly and any problems are likely to be down to a missed step, or a command that has been mis-typed.

The Ghost-CLI is very good at providing feedback on the update or installation process. Our advice here is to check what the terminal shows; check your logs and if all else fails, do a quick Google search with the information shown.

Another useful place to go is the Ghost Forum where you can ask for help and support from other Ghost users.

Latest version of Ghost

At the time of writing, the latest version of Ghost is 2.0.3 (dated 23 August 2018) and is running perfectly well on a Raspberry Pi 2 in parallel to another Ghost blog (my wife's, Simply Archer) on the same Raspberry Pi 2.

In fact, we wrote this guide after upgrading to Ghost 2.0 yesterday (actually it was already at version 2.0.2 when Ghost announced 2.0), to find out that version 2.0.3 had since been released, and running through the same steps to update our blogs again.


If you found this guide, as well as any other guides on Ghost Pi helpful, then if you wanted to buy Ghost Pi a coffee to show your support, then that would be greatly appreciated! As this site does not use any form of adverts, all the costs for running and maintaining the blog are done voluntarily so any extra would be fantastic!