Moving This Blog to Oracle Cloud Infrastructure

A brief Saturday morning adventure moving this Ghost blog to Oracle's free cloud services

Moving This Blog to Oracle Cloud Infrastructure

It all started early this weekend when I opened this site (why? There's nothing on it) and thought to myself: "Gee this is taking an awful long time to load. I wonder if there's a service that loads your website on their end and tells you how long it takes" (spoiler alert: there is, apparently profiling web performance is really serious business)

Well that's not great

So if you've ever scrolled to the bottom of the page, you'd have seen that this blog is powered by Ghost. I really like Ghost, it's clean, modern, open source, dead simple to set up, and supposedly pretty fast. So what gives?

Well for the past few months I have been running Ghost on a little Linux container on an old laptop I had lying around at home.  (btw: laptops make great home servers, they're readily availalble, decently performant, are optimized for low power and have built in bateery backups). While you can't beat the low low price of free, hosting it at home has left me at the mercy of my local power and internet companies (being in South Africa that's quite problematic). Problem is, I'm not nearly fancy enough to shell out actual cash for a website that I may or may not ctually put to use. So now What?

Asking the Oracle

It turns out, that in their push to compete with the other big cloud players, Oracle has been gracious enough to offer up some basic cloud services for free. Free as in nothing, no money, forever (not to jinx it). This includes a dual-core x86 instance with 1GB of RAM, a dedicated IPv4 address and 50GB of storage. That's like $5p/m at Digital Ocean, and they let you have 2 of them!

Oracle doesn't make it difficult either. It took about 10 minutes to make the account (they did however require a credit card for verification), and another 5 minutes to spin up a new Ubuntu VM with the wizard. Another 5 minutes waiting for it to initialize and I was staring at an empty Ubuntu terminal in all it's cursor blinking glory. Easy peasy :)

The Great Migration

Now for the fun part, migrating the Ghost install. Realistically, there isn't really any content that needs to be moved and I could just start fresh but this would be a fun exercise nonetheless.

Installing Ghost

This was really simple. All I really had to do was log in to cloudflare to point the DNS records to the new server and start following the official Ghost install instructions. The setup is well documented and pretty idiot-proof, so no issues there. Well...almost, it looks like the installer was unable to get an SSL certificate from Let's Encrypt. Not a huge deal, we can always try again later.

Wait, It's Not Working...

The moment of truth. I open up a new tab and key in the address. This was too easy, I think to myself. Only to be greeted by:

Was it something I said :(

Ok what about just accessing the ip address directly. Nope. Is it because of the SSL error, let's try http. Nope. Forcing port 80. Nope. HTTP on port 443. Nope (and also really grasping at straws.). Is it the firewall. Nope.

Well it turns out the Oracle is actualy pretty smart and they disable inbound access to newly generated subnets (with the exception of SSh and some ICMP stuff) by default. All it took was a quick trip to the network settings to add an exception to the security list and it should be good to go.

The site is proxied through Cloudflare which forces https and uses it for connections to the origin. So allowing TCP on just 443 should be fine

At this point it also helped to regenerate the SSL certificate with

ghost setup ssl

And just like magic, it works :D

Migrating the Ghost Install

Again, Ghost makes this really simple and all it took was a few steps from the official instructions followed by cleaning up the autogenerated posts before everything was good to go.

Finishing Up

Now for the moment of truth. Is it faster?

Yayyyyy, that's almost 4x faster

So that worked out great. Aside from being much faster and benefitting from a datacenter grade connection, I also no longer have to worry about internet or power issues at home knocking it out. Plus I no longer have to expose my home network to the internet. All that from just 2 hours of setup on a lazy Saturday morning :)

Tl;Dr: Ghost = Good, Oracle Cloud = Good, Ghost + Oracle Cloud = 2Good