Ghost Blogging With a Pi

Isaac Carter

Even you could become a world famous blogger. The lightweight blogging platform Ghost and a Raspberry Pi is all it takes.

The Raspberry Pi Report

I’ve read that a fun and easy thing to do with a Raspberry Pi is to set it up as a dedicated blog server. I’ve never really had my own blog, so I decided I would give this project a shot. I hope that this article serves as a guide for those of you who would like to start a blog or who have a Raspberry Pi that’s not doing anything and are looking for a worthy project.

Hardware: I’m using a Raspberry Pi Model 2 B with a 32-bit SanDisk micro SD card. The reason for using the Model 2 B is because I happened to have one that wasn’t currently being used. Also, I wouldn’t need any of the extras, like Wi-Fi. that the Raspberry Pi 3 brings to the table since it will be connected via Ethernet and SSH.

Software: I installed Raspbian Jessie Lite onto the micro SD card to serve as the OS. The blogging software I decided to go with was the free and open source software known as Ghost. Besides being FOSS, Ghost is a good choice because it’s slimmed down and easy to use.

Because I’ve decided to use Ghost, that means I’ll need to also install Node.js since that is what Ghost is built with and is required to run Ghost.

Set up: In my last article, I talked about how to install BlackArch Linux on the Raspberry Pi and I directly linked to two websites that had great instructions. During my research for this article, I went through many different websites with conflicting install instructions and also found some instructions that lead to errors. After a few rounds of correcting errors and reinstalls, I came up with a set of install steps that I hope helps any readers with their first time Ghost installs or can help those who have attempted to install the platform before on the Raspberry Pi, but ran into problems.

One of the biggest problems is that Ghost does not support the latest Node.js version, which is what every website will instruct you to install if you search for “how to install node.js on the raspberry pi.” This is because Ghost is following Node’s long term support plan and currently only supports Node versions 0.10.x, 0.12.x, and 4.2+. You can actually run Ghost on any version of Node.js by disabling the version check, but don’t plan on getting any support from the platform’s developers for problems that you may run into.

Install steps:

Since we are using Raspbian, update the Debian package repository to include the version of node.js that we are wanting to use.curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -

Install node.js.sudo apt install -y nodejs

Verify node.js was installed.node -v

Download Ghost.wget https://ghost.org/zip/ghost-latest.zip

Unzip Ghost download.

Change to the Ghost directory.

Use npm to install only the dependencies necessary for production.sudo npm install –production

Make a copy of the “config-example.js” file and rename it to “config.js”cp config-example.js config.js

Within config.js there is a “Production” section, and within “Production” there is a small block of code labeled “server” that contains “host” and “port” info. Change the host to be IP of your Raspberry Pi and port to 80.

Start Ghost.npm start –production

Access your new blog.http://(ip address you entered for host in Step 9)/ghost

Hope these steps help you setup Ghost on your Raspberry Pi and get that blog you’ve been wanting to create up and running. If you run into any problems, leave me a comment and I’ll help you work through them. In future articles, I’ll talk about hardening our new blog server and how best to setup Ghost and the Raspberry Pi to make blogging easy.

Related

In addition to hosting a Raspberry Pi meetup in Washington D.C., Isaac Carter is a co-host on mintCast. He's also a software engineer who enjoys working with Java, JavaScript, and GNU/Linux. When he's not coding, you can find him reading on any number of subjects or on the golf course.