On this page
Each major Ghost version supports only a few Node.js versions, and Ghost drops old ones as they reach end of life. Ghost 6 runs on Node.js 22 or 24, the two LTS versions Ghost supports: Node.js 18 and 20 no longer work, and Node.js 24 has been supported since Ghost 6.63. Ghost also raises the minimum release of each from time to time, to pick up Node.js security fixes. When it does, you upgrade Node.js on your server first, then update Ghost.
It pays to stay on a supported version: it’s the one Ghost tests, and the one it fixes issues for. Ghost(Pro) (opens in a new tab) runs the recommended version for you.
This guide is for sites installed with Ghost-CLI on Ubuntu, Ghost’s recommended stack. With Ghost’s Docker setup, Node.js comes with the Ghost image, so you only update the image.
What you need
- SSH access to your server, as a user with
sudorights (notroot). - The Node.js version your Ghost version needs. Check Ghost’s supported Node versions (opens in a new tab) page; in November 2026 that is Node.js 22 or 24, at a recent release.
- A recent backup: run
ghost backupin your Ghost folder.
Setting up a new server instead? Follow How to install Ghost with Ghost-CLI.
Check what you run now:
node -v
ghost version1. Add the NodeSource repository
Ghost’s install guide uses Node.js from NodeSource. Download and import its signing key:
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpgThen add the repository for the Node.js major version you need. Set NODE_MAJOR to it, 22 or 24:
NODE_MAJOR=22
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.listIf you already have a nodesource.list file from an earlier version, this replaces it. To move to a newer release of the same major version, skip this step: step 2 installs the latest release.
2. Install the new Node.js
sudo apt-get update
sudo apt-get install nodejs -yCheck the version:
node -v3. Reinstall Ghost’s dependencies
Ghost has binary dependencies that are compiled for one Node.js version. After a Node.js upgrade they must be reinstalled, or Ghost fails to start with strange errors.
Don’t update Node.js and Ghost in one go. Reinstall the Ghost version you already run first. Go to your Ghost folder (for example /var/www/sitename) and run:
ghost version
ghost update 6.x.x --forceReplace 6.x.x with the version that ghost version shows. --force reinstalls that version and its dependencies.
4. Update Ghost
Once Ghost runs on the new Node.js, update it as usual:
ghost updateIf you’re moving to a new major version, read its breaking changes first, for example Ghost 6: what’s new for publishers. The Ghost version history lists what each release changed.
Fix common errors
Unsupported version of Node
ERROR: Unsupported version of NodeYou may also see Exit status 231. Ghost doesn’t support the Node.js version you installed. Check the supported versions and repeat steps 1 and 2 with the right NODE_MAJOR.
connect ECONNREFUSED ::1:3306
Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database errorNewer Node.js versions resolve localhost to the IPv6 address ::1 first. If MySQL only listens on IPv4, Ghost can’t reach it. See the Ghost forum thread (opens in a new tab) on this error.
The fix is to point Ghost at the IPv4 address:
Open
config.production.jsonin your Ghost folder.In the
databasesection, changehostfromlocalhostto127.0.0.1:JSON"database": { "client": "mysql", "connection": { "host": "127.0.0.1", "user": "your_user", "password": "your_password", "database": "your_database" } }Restart Ghost:
Terminalghost restart
The result
Your server runs the Node.js version Ghost requires, Ghost’s dependencies are rebuilt for it, and you can keep updating Ghost as usual.