To start, ghost doctor
told me my version of node was out of date. I installed and used n
to update to version 18.x per this page in docs.
After upgrading node, I got the following error:
1) GhostError
Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database error
I followed the steps in this guide with no success.
I created a new Linode server following these guides. When I got to ghost install
I had another issue with mysql during setup where it failed to create a new mysql user (see last line) and then would have the same error as above:
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: larkinministries_prod
âś” Configuring Ghost
âś” Setting up instance
+ sudo chown -R ghost:ghost /var/www/larkinministries/content
âś” Setting up "ghost" system user
? Do you wish to set up "ghost" mysql user? Yes
âś– Setting up "ghost" mysql user
I tried the recommendations from these posts
No success. Then I installed n
on this new server and changed node version from 18.x to 16.x and after this, everything worked and the site is up on the new server. So it seems the issue was caused by the node version even though Ghost documentation says v18.x is supported and actually recommended. All I know is v18 did not work and v16 does.
So then I want to switch the original server to node v16 from v18 since that was the fix I found on the new test server. On the old server, using n
to downgrade node from 18.x to 16.x results in the following ghost doctor
output:
âś” Checking system Node.js version - found v16.20.2
âś” Checking logged in user
âś” Ensuring user is not logged in as ghost user
âś” Checking if logged in user is directory owner
âś” Checking current folder permissions
âś” Checking system compatibility
âś” Checking for a MySQL installation
+ sudo systemctl is-active ghost_www-sitename-com
Instance is currently running
ℹ Validating config [skipped]
âś” Checking folder permissions
âś” Checking file permissions
âś” Checking content folder ownership
âś” Checking memory availability
âś” Checking binary dependencies
âś” Checking free space
âś” Checking systemd unit file
Warning: Ghost is running with node v18.17.1.
Your current node version is v16.20.2.
âś” Checking systemd node version - found v18.17.1
Note that system Node.js version - found v16.20.2
but Warning: Ghost is running with node v18.17.1. Your current node version is v16.20.2.
I tried using n to uninstall all other versions of node, tried updating ghost-cli, and updating ghost itself
How can I get Ghost to run under node version 16.20.2 (installed) and not 18.17.1 (which I uninstalled and which was not working)?
Trying ghost start
just hangs indefinitely. Hitting ctrl-c to stop it results in the ghost process running but with a 502 error if you try to access the site. Ghost restart also just hangs indefinitely. (I left it for 15m and it was still trying)
Debug Information:
OS: Ubuntu, v20.04.6 LTS
Node Version: v16.20.2
Ghost Version: 5.59.3
Ghost-CLI Version: 1.24.2
Environment: production
Command: 'ghost start'