Wrote a script to update Google Cloud Micro Instances

I was having challenges updating Ghost on a resource constrained free-tier micro instance. So, I wrote a script to help automate it and described it on my blog.

It creates a machine image of your active Ghost instance on Google Cloud, spins up a new VM from that and updates Ghost on it and then offers to move your static IP from your old VM to your new VM so you can cut over to it with minimal downtime.

There are screenshots and a video showing the script works.

Anyways, figured I’d share since self-hosting is a bit time consuming!

Refactored the code last night making it much easier to read and understand. Also, introduced a feature to reboot the new VM after updating system packages before updating NPM and Ghost. And, created an option (that’s commented out by default) to update on a beefier machine to speed things along a tiny bit. It’s pretty nifty.

Recently updated my bash script to automate machine image backups and updating Ghost on a VM in Google Cloud for folks who wish to upgrade to v6 GitHub - danielraffel/gCloud-Ghost-Updater: A user-friendly script designed to reduce downtime while updating a Ghost instance hosted on Google Cloud. I setup my (free) Ghost instance on GCP with this script so I know they work well together (note: I haven’t run it the setup in awhile) GitHub - danielraffel/gcloud_ghost_instancer: A user-friendly script designed to install Ghost on a Google Cloud free-tier E2-Micro instance.