Before updating to a new major version, you must update your site to the latest minor version, e.g if you are on 4.23.0 you need to be on 4.48.9 before updating to v6. You also need to make sure that your setup meets all the latest requirements. This guide will take you through everything step-by-step. Updates are recommended for sites that are:
- Running Ghost version
3.0.0
or higher and are using MySQL in production - Development sites using any database
The web analytics feature is not compatible with Ghost-CLI. There is a docker-based hosting method currently in preview, which includes a migration tool for Ghost CLI sites: check it out.
Switch user
Switch to the user you used to setup your Ghost install for running Ghost commands:Update Node
Runnode -v
to check your node version.
If less than 22, update node:
Update Ghost CLI
Ghost-CLI is an npm module that can be updated using npm:ghost -v
to see what version of Ghost-CLI you have. For Ghost 6.0, it’s best to have v1.28.2 or higher.
Update to the latest minor version
Before updating to a new major version, you must update your site to the latest minor version and not be more than 2 majors behind. First, perform a backup of your site:ghost backup
Then, update to the latest minor version:
- On Ghost 3.0 run
ghost update v3
and thenghost update v4
- On Ghost 4.0 run
ghost update v4
- On Ghost 5.0 run
ghost update v5
ghost start
, then login to Ghost Admin and check this update has worked before continuing.
Make a full backup
When performing manual updates it’s a good idea to make frequent backups, so if anything goes wrong, you’ll still have all your data. Once you’re running the latest minor version, make a full backup using the following command to generate a download of your site’s data:- Your content in JSON format
- A full member CSV export
- All themes that have been installed including your current active theme
- Images, files, and media (video and audio)
- A copy of
routes.yaml
andredirects.yaml
orredirects.json
Check MySQL version
MySQL 8 is the only supported database in production. Use the following commands to check your database version:sqlite3
or mysql
. If it says mysql, run mysql --version
to find the details of your mysql install.
If you’re already running MySQL 8, proceed to the next steps. Otherwise, read more about how to update or migrate your database if you’re using any other version.
Review breaking changes
Major versions often contain breaking changes that impact themes and the API. Ghost CLI will output a report with any theme incompatibility errors and recommendations, or you can upload your theme directly to the GScan theme testing tool. If you make use of the API e.g. in themes, custom integrations or on a headless site, you should carefully review changes to the API before updating to ensure you don’t need to update your custom tooling first. For example in Ghost 6.0 we’ve removed support for?limit=all
and many integrations may need to add pagination in order to handle this.
Get ActivityPub ready
If you’d like to use the social web features, you can use the Ghost(Pro) hosted ActivityPub service. This is done by adding two new location blocks to your nginx.conf file as shown here. The file can be found in:Update to the latest major version
Finally, you can now run the update command again to upgrade to the latest major version:Troubleshooting
The most common reason for an update failure is running out of memory, so make sure you have enough RAM or swap configured in advance.Find your Ghost folder
Run theghost ls
command anywhere on your server to find the details of your Ghost install.
Download your backup
If you need to move your backup between machines, run thescp
command on the machine you want to move the file to: