Don't Run Multiple Ghost Instances on a Small Virtual Machine

Just Because You Can Do It. Doesn't mean you should...

Lately I've been playing a great deal with Content Management Systems. Well one in particular: Ghost

I even wrote an article on how to host multiple instances of it on one DigitalOcean Droplet.

And it worked fine.

You can very easily run more than one instance of Ghost from a tiny virtual machine. The sites ran fast according to Google PageInsights. Never had any issues writing, publishing or accessing Ghost.

Until...

I went to upgrade the Ghost instances on darrenbeattie.com and dailytrainingsession.com recently.

Turns out I may have missed something important from the self-hosting requirements:

"A server with at least 1GB memory"

Now the $5 droplet on DigitalOcean has that, but I'm sure they mean per instance.

Turns out, while not a problem for running Ghost, it's a problem for updating Ghost. And trying to update using their very good CLI tool to upgrade either instance tells me there isn't enough memory on that sized droplet.


Good thing I hadn't gotten around to moving Skill Based Fitness to a new Ghost instance on the same server. I may have discovered the limitations of the $5 droplet running.

I had thought about it, and desperately want to move it away from Wordpress. The Google Page Insights have been absolutely terrible on that Wordpress site for years and my pre-paid hosting will be running out soon.

My Bad.

It's no wonder, that no one had readily written about it and I had such difficult time piecing it together. Good learning experience all the same. Especially about NGINX and DigitalOcean deployment.

Ghost is a slick, beautiful writing experience, that runs blazing fast but is a bit of a memory hog it turns out.

I mean, should I really complain? It's only 1GB worth of RAM. The computer I'm writing this on has 16x that.

I probably saw it, I simply chose to ignore it because spending $5 a month for three sites versus $15 seemed like a steal. A cheap way to play anyway.

As it turns out, you may want to consider some workarounds for long-term maintenance. That is, if you ever want to upgrade Ghost.

Workarounds

There are a few things to consider...

Increase the Droplet Size

The most obvious one is to stop the virtual machine, and upgrade it to the next size (2GB) droplet at $10/mo. Then upgrading Ghost should work just fine, depending on how many instances you have on your droplet. No different really from running separate $5 droplets for each site. Save a more complicated config.

You could possibly even downgrade back to the $5 droplet upon completion but this will be annoying every time you want to upgrade ghost. They push new releases monthly. And you probably should upgrade to stable releases at least on a semi-regular basis. You're risking data corruption to an extent by messing around with this too much.

Good quick work around, but likely not ideal for me long-term. I want to simplify my approach, not increase the complexity.

Embrace the JAMstack Further

If/when you're using Ghost as a headless CMS (which DTS.com and DB.com are not currently) it basically becomes your back-end. Assuming you aren't building anything more complex than a web page/blog.

I suspect (but have not confirmed) I can deliver content to two different front ends via webhooks from one Ghost instance on a single droplet. You're basically just exposing the Content API to two different places. Use tags to split the content to its appropriate front-end location.

Then simply design two different front ends using Gatsby or Next (or both?) and statically generate the front-end using service like Netlify (who coined the term JAMstack) or Vercel (creators of Next.js). Both of which wouldn't cost me anything, assuming the traffic doesn't get crazy.

Unlikely for DB.com, but I'm secretly hoping it might happen to DTS.com. 🤞

If I don't burn out first, writing 500-1000 word workouts every day. I may need to slow the pace to keep the time investment reasonable or build something entirely from scratch anyway. I'm not ruling that out. In theory, it should work.

Currently the problem I'd run into trying to implement this is the heavy integration with Ghost's membership functionality for DTS.com.

There is no way currently to implement a membership functionality that is anywhere near as slick (as they've built) into a JAMstack implementation. 😞

Without building something from scratch anyway. It's in beta, mind you, so that functionality could disappear entirely or maybe version 4 will feature JAMstack member support.

There's no way to know.

I'd even consider Ghost.org hosting plan if I could have one well managed instance serving multiple front ends. I can dream right?

Prioritize

What do I need/want the Ghost writing experience most for?

It's probably not DB.com. It's a small low-traffic website to show off my developer oriented (occasionally business-oriented?) thoughts. I occasionally publish ideas here. I write on DTS.com daily and SBF.com (Skill Based Fitness) weekly.

It doesn't make sense to have a separate Ghost instance for DB.com, when I write so infrequently here. I simply wanted to retake my name domain that I had let sit dormant for too long. It should be the first thing served when someone Googles my name.

I can do that with a static front end and likely something else that isn't Ghost. I can then link to Medium or something for my writing or utilize a hosted but free JAMstack CMS like Contentful, DatoCMS or Netlify CMS.

All of which I've been investigating and have a terrible writing experience compared to Ghost. Contentful and DataCMS free tiers might be enough for a tiny amount of content at least but their pricing is absolutely ludicrous for a hobbiest.

They are also overkill. More like a full back-end API on demand, which could be fun to play with on some other projects.  

Right now I'm leaning towards Netlify CMS because it appears to be free without limitation – it ties directly into GitHub. While not the best writing experience, nor as easy to get started with, it still is a good developer experience.

At least it'd be a good way to add to my lack of commits lately.

🤷‍♂️ In any effect you'll probably see some changes to darrenbeattie.com in the coming days/weeks and eventually DTS integrated into SBF.com so it can be served on one droplet with one ghost instance.

Maybe one day I'll look into serving one ghost instance to multiple domains and as always I'll let you know how that goes.

Darren Beattie

Read more posts by this author.