Ghost installation for Raspberry Pi…

Ghost is a new blogging platform. It has a refreshingly innovative and responsive UI – one that can clearly be seen as the future of blogging. You might want to visit Ghost’s website to know more about it. I promise, once you’ve learned how it works, you won’t stop thinking about it. While you’re at it, do learn how it’s installed on the Raspberry Pi from our tutorial below.

Ghost

Ghost runs on Node.js and, like WordPress, is free to download and use. It is expressly intended to be a blogging platform unlike the recent evolution of WordPress.

Wait! Node.js?!

500px-Node.js_logo.svg

Node.js is an event driven system that is written in Javascript and C++. It is known for its non-blocking I/O system and higher response speed with simultaneously lesser resource consumption. Node.js is widely used in chat web application, but can definitely do a lot more like handling entire blogs as it would with Ghost.

Installation of Ghost

There are a lot of operating systems available for the Raspberry Pi but, for this, we recommend using Raspbian. The rest will be a breeze.

1. Install Node.js

You will have to have Node.js installed on your Raspberry Pi. As a matter of fact we’ve written a tutorial on how you can do just that right here.

2. Acquire the Ghost setup

Download the package

To install Ghost, it’ll need to be download from the official website. Do that by entering the following in the terminal.

<code>wget https://ghost.org/zip/ghost-latest.zip</code>Code language: HTML, XML (xml)

Unzip the package

Now that the package has been downloaded, it will have to be unzipped. You can simply do it by entering the command.

<code>unzip ghost-latest.zip -d ghost</code>Code language: HTML, XML (xml)

The package contents will fill a new directory by the name ghost.

3. Focus on the new folder

To set the Ghost folder ghost as current directory use the command.

<code>cd ghost/</code>Code language: HTML, XML (xml)

4. Install Ghost from the setup

After focusing on the ghost directory, we need to install it using NPM by entering the command below.

<code>sudo npm install --production</code>Code language: HTML, XML (xml)

5. Install a database management system

For your database management system you can choose your favourite one and use it with Ghost. We ourselves have done it a few times with MySQL and MariaDB. We’ve gone for SQLite for this tutorial – the Ghost configuration file by default uses SQLite. You can install SQLite3 using the command below.

sudo apt-get install sqlite3Code language: JavaScript (javascript)

6. Edit the configuration file

If you use MariaDB, MySQL or a different management system make the appropriate changes to the settings in config.js file of the Ghost setup.

Edit the config.js file to change the default host: and set the port: to 80 as seen below. That is, of course, unless you’re fine with using the default settings.

<code>host: '0.0.0.0'</code>Code language: HTML, XML (xml)
<code>port: '80'</code>Code language: HTML, XML (xml)

7. Set up Forever

Once we’re done editing config.js, we need to install Forever so we could continue running the Node.js web-server after the end of the SSH session.

Install forever

Enter this command.

<code>sudo npm install forever -g</code>Code language: HTML, XML (xml)

Set Node.js to run with Forever

This will let Node.js continue running despite being in production mode. Enter them one after another.

<code>sudo NODE_ENV=production forever start index.js</code>Code language: HTML, XML (xml)
<code>sudo forever index.js --production</code>Code language: HTML, XML (xml)

And that’s it!

You’ll have successfully created a Raspberry Pi hosted Ghost blog on its Node.js web server.

You’ll have to visit [the-IP-address-of-your-Raspberry-Pi]/ghost/ to access the process of creating your user account the first time. The process takes a while because the password is hashed using Bcrypt. Once done, that URL acts as your Ghost admin panel.

The blog can be accessed as a non-admin viewer using your Raspberry Pi’s IP address.

Cool, isn’t it?! Do leave us comments if you’ve decided to give it a try or have tried alternate methods for installation. Feedback is always appreciated. Do stay tuned for more on Ghost in the future…