Before you upgrade to Ghost v5.71.0 (Selfhosted only)

I am using Ghost self-hosted version. Ghost released v5.71.0 and it says they dropped support for Nodejs 16.

So before you update Ghost CLI and Ghost, please upgrade your Nodejs version to 18. The only Nodejs support for Ghost is 18.x (Node v18 Hydrogen LTS)


Source: Release 5.71.0 · TryGhost/Ghost · GitHub


Source: Supported node versions for self-hosted installs of Ghost

2 Likes

lol, and here I am impatiently waiting for v20 support :rofl:

Support for Node v20 is coming soon! Need to resolve some of the issues first :slightly_smiling_face:

I have a problem. I am currently using Node.js version 18.17.1. What is the best way to update my Node.js version to 20 when Ghost supports version 20, without breaking my website? Could you please show me the steps?

PS. I am not using NVM.

Just checked now and I have Node v16 on my Droplet. I wonder what are the steps to exactly install the v 18 without breaking anything. I found a guide on DO about using NVM but I’m not sure.

Can I ask what are the commands you used to install the 18.x (Node v18 Hydrogen LTS)?

I’ve started upgrading to the v18 using this guide. Ghost admin panel is now unreachable and the process already started 15 minutes ago. I wonder how long it takes to upgrade Node from start to finish?

Run ghost update —force when finished.

Did. Now I have this error in the console:
Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Apparently the new Node 18 breaks something.

What is your website?

Actually in August I migrated my server. At that point I installed v18.

Anyway, here is the guide by @Hannah

Replace 10 with 18

Did you ran

sudo npm install -g ghost-cli@latest

after updating Nodejs and update Ghost?

Yes, I first updated Node, then panicked and also updated Ghost itself. Now everything works. I solved by removing the line that starts with ::1 in etc/hosts. I found the solution on Stack Overflow:

localhost is translated to ::1 (IP6) instead of 127.0.0.1 (IP4). The error occurs because your database is listening on localhost and you try to connect to 127.0.0.1 or the database is listening on 127.0.0.1 and you try to connect to localhost.

The line I removed in hosts is the following:

::1 localhost ip6-localhost ip6-loopback

Now I have the shiny new Ghost, even if I didn’t really want to upgrade also that, but just the Node :stuck_out_tongue:

1 Like

Have a look here:

1 Like

Did you delete the entire line?

Yep. Also here: Ghost Update: ECONNREFUSED ::1:3306 + Error code 502 - #2 by markstos

Yes. The moment I removed it and saved, Ghost started working. So I guess it was definitely that.

1 Like

Your host is only on ip4. Isn’t it?

This will be helpful to me when I’m updating to v20. :smile:

No, I have also ipv6. My hosts file is now the following:

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 ghostonubuntu2204-s-1vcpu-1gb-intel
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Before was this:

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cg or cloud-config from user-data
127.0.1.1 ghostonubuntu2204-5.-1vcpu-1gb-intel
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback 
ff02: :1 jp6-allnodes 
ff02: :2 ip6-allrouters

Should I change something?

This is how mine looks like

127.0.0.1       localhost
127.0.1.1       vmi*******.contaboserver.net    vmi********

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
109.***.***.***    vmi********.contaboserver.net vmi******