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

**URL:** <https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292>\
**Category:** Using Ghost\
**Created:** [October 30, 2023, 4:54am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292 "2023-10-30T04:54:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 4:54am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/1 "2023-10-30T04:54:59Z")

</div>

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)**

 ![Screenshot 2023-10-30 at 10.14.00 AM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/8/a/8a8a9a4dc0792ffdb70afbb1e176fc54a17b5a9b.png)  
_Source: [Release 5.71.0 · TryGhost/Ghost · GitHub](https://github.com/TryGhost/Ghost/releases/tag/v5.71.0)_

 ![Screenshot 2023-10-30 at 10.14.23 AM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/1/6/166bf7cb43455db402d2f432eae81ead2a228d16.png)  
_Source: [Supported node versions for self-hosted installs of Ghost](https://ghost.org/docs/faq/node-versions/)_

---

<div class="post-metadata">

**Author:** ![jeff](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jeff/32/4900_2.png) [@jeff](https://forum.ghost.org/u/jeff)\
**Post date:** [October 30, 2023, 5:08am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/2 "2023-10-30T05:08:14Z")

</div>

lol, and here I am impatiently waiting for v20 support 🤣

---

<div class="post-metadata">

**Author:** ![daniellockyer](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daniellockyer/32/11993_2.png) [@daniellockyer](https://forum.ghost.org/u/daniellockyer)\
**Post date:** [October 30, 2023, 8:28am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/3 "2023-10-30T08:28:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 8:37am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/4 "2023-10-30T08:37:08Z")

</div>

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.** _

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 9:09am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/5 "2023-10-30T09:09:49Z")

</div>

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](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04#option-3-installing-node-using-the-node-version-manager) but I’m not sure.

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

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 9:53am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/6 "2023-10-30T09:53:50Z")

</div>

I’ve started upgrading to the v18 [using this guide](https://kyleunboxed.com/updating-node-for-ghost-5-47-0-on-digital-ocean/). 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?

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 9:57am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/7 "2023-10-30T09:57:59Z")

</div>

Run `ghost update —force` when finished.

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 10:15am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/8 "2023-10-30T10:15:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:16am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/9 "2023-10-30T10:16:05Z")

</div>

What is your website?

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:17am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/10 "2023-10-30T10:17:33Z")

</div>

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

Anyway, here is the guide by @Hannah

Replace 10 with 18

> [@Update Node (Digital Ocean)](https://forum.ghost.org/t/update-node-digital-ocean/9407/2):
>
> The DigitalOcean one-click App uses nodesource.
> 
> I recommend updating to Node v10 (v8 is almost end of life)
> 
> > curl -sL [https://deb.nodesource.com/setup\_10.x](https://deb.nodesource.com/setup_10.x) | sudo -E bash -  
> > sudo apt-get install -y nodejs  
> > ghost update --force
> 
> One you’ve updated node, you must run `ghost update --force` in the ghost directory, this will force Ghost to update its dependencies to match Node v10, otherwise you’ll get more errors.

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:19am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/11 "2023-10-30T10:19:34Z")

</div>

Did you ran

`sudo npm install -g ghost-cli@latest`

after updating Nodejs and update Ghost?

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 10:26am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/12 "2023-10-30T10:26:22Z")

</div>

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 😛

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [October 30, 2023, 10:28am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/13 "2023-10-30T10:28:36Z")

</div>

Have a look here:

> [@Upgrade ghost 5.71.0 with node 18, encountered error](https://forum.ghost.org/t/upgrade-ghost-5-71-0-with-node-18-encountered-error/42246/4):
>
> Node 18 prefers ipv6 resolution over ipv4 - you can see this in the error message with the MySQL connection ::1:3306. If your MySQL server isn’t listening on the ipv6 interface then node won’t be able to connect to it. Quickest fix is probably explicitly specifying 127.0.0.1 for your database host in place of localhost in your Ghost config.

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:30am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/14 "2023-10-30T10:30:40Z")

</div>

Did you delete the entire line?

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 10:31am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/15 "2023-10-30T10:31:02Z")

</div>

Yep. Also here: [Ghost Update: ECONNREFUSED ::1:3306 + Error code 502 - #2 by markstos](https://forum.ghost.org/t/ghost-update-econnrefused-3306-error-code-502/41859/2)

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 10:31am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/16 "2023-10-30T10:31:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:32am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/17 "2023-10-30T10:32:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:34am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/18 "2023-10-30T10:34:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [October 30, 2023, 10:36am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/19 "2023-10-30T10:36:34Z")

</div>

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

```auto
# 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:

```auto
# 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?

---

<div class="post-metadata">

**Author:** ![thimiraonline](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thimiraonline/32/22599_2.png) [@thimiraonline](https://forum.ghost.org/u/thimiraonline)\
**Post date:** [October 30, 2023, 10:39am UTC](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292/20 "2023-10-30T10:39:29Z")

</div>

This is how mine looks like

```auto
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 ******

```

[Next page](https://forum.ghost.org/t/before-you-upgrade-to-ghost-v5-71-0-selfhosted-only/42292.md?page=2)
