If you’ve been visiting Code Curated for a while, you know I moved my blog from using Wordpress to Ghost after only used the WordPress for 1 month. I also have written some guide about how to set up Ghost in DigitalOcean. Ghost is a really light and responsive publication CMS which I recommend if you want to focus on publishing articles.
Recently, Ghost has just launched its major update, Ghost v4. After reading the change log, I tried updating Code Curated to Ghost v4 from Ghost v3.
In this article, I will write how I updated Code Curated to Ghost v4, my first impression and speed testing before and after the update.
Updating Self hosted Ghost v3 to v4
Before starting, note that I'm using a DigitalOcean as my hosting service, so in this section, I'll only write about how to update Ghost to v4 for DigitalOcean.
The first thing you want to check is regarding the compatibility of your theme to Ghost v4. Ghost has provided a website to check whether your theme is compatible with Ghost v4 here.
After you make sure that your theme is compatible with Ghost v4. You'll want to login to your DigitalOcean account, access your droplet and start taking a snapshot. We don't want our site to become broken if something goes wrong with the update. With snapshot, you can easily revert your droplet into the state when you took the snapshot if something broke.
Before we start the update, let’s go over the plan. My plan is to just update the Ghost directly in my production server. This is simpler to do, but will introduce a small down time to your Ghost server. The better practice is to create a new droplet with the snapshot you just took, update the ghost in the new droplet, and then change where your floating IP is pointing to after everything went fine.
If your website already has a lot of visitors, then I recommend you to use the better practice. In my case, I’ll update my production server because the downtime is only about 1 minute.
First, do an SSH to the droplet that you want its Ghost to be update.
After that, change to
ghost-mgr user (might be different depending on how you install your Ghost) with
sudo -i -u ghost-mgr. Then, change the directory to the Ghost root installation directory, which by default is
/var/www/ghost, we can use
We then need to update the ghost-cli to the latest version by running
sudo npm i -g [email protected].
Now, we're ready to update our Ghost! Remember that there will be some restarts that will introduce a downtime when you're updating your Ghost.
Before we update our Ghost to v4, we'll need to update it to the latest v3 first. To update your Ghost to the latest v3, you can run
ghost update v3
If everything went fine, the Ghost should be updated to the latest version of version 3. Now we can start the update process to Ghost v4, for this, we can run
Ghost-cli then will check your active theme and warn you if there is any warning or error.
Ghost-cli will also give you some links that you need to check regarding compatibility and breaking changes, make sure you check that before you update! It will then ask you whether you're sure you want to update, if you're already sure, hit your enter button.
After it's finished downloading, Ghost will stop your server, install the update, and then restart your server.
When it's finished, you can then visit your website to make sure that there is nothing broken there. You can also visit the admin page of your Ghost website to make sure that the update is successful.
The first thing I want to mention is the smoothness of the updating experience. It would differ from person to person, but in my case it was very smooth. I found no unexpected error when updating my Ghost to v4. I also appreciate that the Ghost team created a theme compatibility checker website to make sure we know if our theme will be a problem after the update.
When updating a major version, I expected some kind of breaking features that need to be troubleshooted and fixed manually. But I found nothing breaking. Every feature I’ve tested works flawlessly. My theme that has gone through the theme compatibility scanner also works perfectly.
The admin page has received a UI UX redesign, it’s now more modern and clean. From what I’m experiencing, the admin page that was already quick in v3 is even faster and smoother.
When you open your admin page, the first thing you’ll see is the dashboard. The dashboard contains tips about what you can do with Ghost and also publication. It also shows a “What’s new” tab containing new updates of Ghost, which will be useful so you can know that there is a new version of Ghost available.
The memberships, subscription and newsletter feature that was in beta on version 3 is now stable and built native to Ghost. It’s now always active, so you don’t need to active them in the “Labs” section anymore.
The writer is pretty much unchanged. The background is now darker, more easy on your eyes and also reduce a bit of your electricity usage.
One bug I found is that when you insert a link, the color of the link is the same with the background, therefore you won’t be able to see the link. Below is the example of a link I inserted in this article, I circled the link in the red pen (It has been fixed in Ghost 4.1).
The editor is also now smoother. In the v3, I experienced some lag and delay when I'm writing an article containing more that 2500 words. But, in v4, everything is still smooth.
The visitors side
The most important thing in a CMS is how visitors experience your website. After updating the Ghost, I’ve not yet found any errors. Everything is smooth and nothing is breaking.
In Ghost v4’s change log, it’s said that now every image will be lazily loaded, and there is also a code refactor that resulted in faster speed. So, I tested it with google page speed insight before and after the update.
As you can see, the speed is pretty much the same. This might be because I'm using a theme that supports lazy load and also a CDN. Looking at the speed result, though, I'm amazed that Ghost can give this kind of speed even though I'm hosting my Ghost on the cheapest droplet in DigitalOcean.
As you can see, the speed is the same. This might be because I’m using a theme that supports lazy load and also a CDN. Looking at the speed result, though, I’m amazed that Ghost can give this kind of speed even though I’m hosting my Ghost on the cheapest droplet in DigitalOcean.
Cheers to Ghost team for a wonderful work, and I hope the quality won’t be dropping in the future.