Does anyone have experience with Node snap package on Ubuntu with Ghost installation? (It might not be recommended?)
I have done a Ghost upgrade and Node.js needed to be upgraded to a newer version than Ubuntu provided on the current package manager.
I had a look at the snap package option for node. It seemed to be quite a good option (to me) for managing node versions. (Simple install and remove commands etc)
Examples:
sudo snap install node --classic
OR
sudo snap install node --channel=18/stable --classic
So I decided to give it a go for my ghost installation. (I got backup and snapshot to roll back my changes)
Installation Information:
OS: Ubuntu, v22.04.4 LTS
Node Version: v20.14.0
Ghost Version: 5.82.12
Ghost-CLI Version: 1.26.0
Environment: production
Command: âghost doctorâ
After I did the upgrade to Node v20.14.0, I ran ghost doctor.
Ghost Doctor Results:
Checking system Node.js version - found v20.14.0
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_****************-co-uk
Validating config
Checking folder permissions
Checking file permissions
Checking content folder ownership
Checking memory availability
Checking binary dependencies
Checking free space
Checking systemd unit file
Checking systemd node version
One or more errors occurred.
- SystemError
Message: Unable to determine node version in use by systemd
Help: Ensure âExecStartâ exists in /lib/systemd/system/ghost_*********-co-uk.service and uses a valid Node version
I then changed the file as requested.
Old Config:
[Unit]
Description=Ghost systemd service for blog: ***********-co-uk
Documentation=Ghost: The #1 open source headless Node.js CMS
[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=999
Environment=âNODE_ENV=productionâ
ExecStart=/usr/bin/node /usr/bin/ghost run
Restart=always
[Install]
WantedBy=multi-user.target
New Config:
[Unit]
Description=Ghost systemd service for blog: ************-co-uk
Documentation=Ghost: The #1 open source headless Node.js CMS
[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=999
Environment=âNODE_ENV=productionâ
ExecStart=/snap/bin/node /usr/bin/ghost run
Restart=always
[Install]
WantedBy=multi-user.target
Current State
I then tried to run ghost doctor and got the same issue, which has confused me.
I have rebooted the server just encase it needed services restarted but still the same issue sadly.
If anyone has any advice or additional information, I would be much appreciated. I will do my own research and will try to update this forum post If I find anything.
Thanks for taking the time to read this post.