Four years ago I installed Ghost on my web host on a whim. I had run self-hosted blogs before in the past, and I guess I had some nostalgia for those days. I made two posts (as you can see) then promptly forgot about it. Fast forward to today and a friend mentioning that Blogs were a quaint blast from the past that were easily RSS-able and that got me thinking about this blog.

This was a mistake.

Turns out this Ghost install dates back to the prehistory of the project. It was running v1! Surely I can update it to the current, right? I am sure it's technically possible, but the combination of vague to outright incorrect information plus my own mounting hate of this very blog worked against me.

Technically a ghost update should have gotten things rolling. Except that it said that I was running an incompatible version of node.js. I had node.js 12.something and it wanted node.js 8.9.0! Well, thankfully Node lets you run old versions of itself, so a nvm install 8.9.0 got us up and running there. Continued attempts at ghost update told me that I needed to make sure v1 was as up-to-date as possible before trying to install v2, so I ran ghost update --v1 and it completely successfully. ghost update should work now, right?

It did not work.

At this point I started to try to update the ghost-cli install with npm install ghost-cli@latest -g which would come back with various versions of "Yup, installed" or "hey, there are some warnings, but they are cryptic node.js warnings" nothing that said "this ain't it, chief", so I pressed on. Continued ghost updates gave me the same run around about upgrading v1 first. New plan: back up the previous two posts to a .json file and nuke the install.

Reader, I even did this wrong.

In a bit of a red haze I ran sudo rm -rm ./* in my ghost install directory. "That'll fix you!" I thought. It turns out they provide you with a handy ghost uninstall command, and it was now somewhat unhappy with the empty ghost install directory. Thankfully you can fake it out with a quick mkdir content. So after running it again, I am back to ghost square one, right?

I was not.

So a basic problem plagued me at this point. Running ghost install would tell me that my ghost-cli needed to be updated via npm install ghost-cli@latest -g, which I have already done several times. Running that now would tell me that I am running the wrong version of node.js and it should be the latest. So I run nvm install 19.0.0 to get the newest node.js. The ghost install complains about it not being 8.9.0. The light finally dawns.

Running >npm install ghost-cli@latest -g as I had been was just a placebo.

Since I am a filthy heathen that runs Debian and not Ubuntu, I apparently should have been sudoing that command. The github readme.md page doesn't tell you this. The official documentation doesn't tell you this. It's not until you dig up the ghost-cli documentation that they reference running it as sudo. So. sudo npm install ghost-cli@latest -g. Something actually happens! Now it tells me I need to be running node.js 16.13.0. ARG!

A quick nvm install 16.13.0 and I can actually get ghost-cli to update. GOOD! GREAT! PERFECT! It's just a matter of running ghost install, answering some questions, finding out that I need to be running a full mariadb stack, aborting the install and running ghost install --db=sqlite3 and completing the steps. Blog time!

Welcome to 502 gateway errors.

I now get to start digging through nginx configs and running 'ghost ls' to try to find out what is happening. The ports line up! Things should be running! Well, remember when I said I don't run Ubuntu? It turns out that I have to run 'ghost install local' in order to get anything working. More ARG! So: 'ghost uninstall' then 'ghost install local'. Now we are blogging.

I create a user and got the blog config'd, chose a theme and then sat down to write this post. Except the preview wasn't working. It wanted to try to load 127.0.0.1:ghostport instead of the actual blog url. Well that's not right! surely a quick ghost setup to change the URL from localhost to the actual URL will fix this! Except it didn't. The post still wouldn't preview. Maybe I need to restart ghost? Yes, this is likely what I need to do! So a quick ghost stop followed by a ghost start and we should be gravy!

We are not gravy. We are un-gravy.

It doesn't want to start. I am logged in as my local user (as I am supposed to be). The content directory is owned by ghost:ghost. It won't let me start ghost when the content directory isn't owned by the current user. Since the ghost account isn't known to me, let's just sudo chown -R local_user:local_user ./content/. And now ghost will start again. Excellent! I refresh the admin interface and...

It's back to the Out Of Box Experience. Create a user account. Pick a theme. What?

I don't have an answer for this one. I have re-done the entire site from scratch, again (missing the first version of this post, naturally) and re-uploaded the json'd previous posts and then typed this monster up again. If it re-OOBEs itself again, I am just giving up.

In conclusion: If you ever forget you have a ghost install set up, continue forgetting it exists. Take it from me.

Nov 2, 2022 Update - So upon restarting Ghost it wiped the site AGAIN so I rage deleted the whole thing, but not before exporting this massive blog post. Now that I have had a nice rest and gotten Grav installed, this post can again see the light of day!

Blog Comments powered by Disqus.