Still unable to update self-hosted Ghost blog

Yes, that would simplify the upgrade process. I presume there are already good Ghost SQLite to MySQL migration guides out there, but ask a separate question here if you get stuck.

Addressing Node version problems

I also ran into some Node version upgrade problems. Here’s some general advice:

  1. Don’t use nvm for installing node. That tool switches between Node versions based on environment variables. This makes it fragile. For example, Ghost is run by systemd, which tightly controls the environment variables that are set for the the service. I doubt anything installed via nvm is going to be visible to the systemd service. The official Ghost docs recommend installing Node from a custom repo, so you could try that. How to install & setup Ghost on Ubuntu 20.04 or 22.04

Time to containerize?

For a long time I have advocated for using the Ghost CLI method of installing recommended by the official install doc. But as your case and mine illustrate, even seasoned Linux managers can get tripped up by Node version upgrade problems.

Containers eliminate that issue, by bundling the precise required Node version needed with the software itself.

So when I rebuilt my server most recently, I did not install Node at all. Instead, I installed Ghost in containers.

Now, containers bring their own set of complexity, but they are also extremely popularly and lots of people understand how to solve container-related problems now. The Ghost container on Docker hub has over 100 million downloads at this point . If you go that route, you have set up for yourself details like making sure the service starts at boot an handling a reserve proxy for it yourself, but there are a lot of guides for setting up Ghost in a container out there at this point.

Personally, I use Ansible and Podman at work to manage containers so that’s how I’m managing mine: Interested in Ansible Role to install Ghost to run with podman containers / systemd / private networking?

Docker is more popular and their are plenty of guides for that:

1 Like