Installing Ghost

Ghost is a blogging platform wrote in Node.js. Ghost supports and only supports Markdown, which allow writers write using an easy-to-read, easy-to-write plain text format.

In this tutorial, you will need a server with Ubuntu 14.04 LTS installed. I suggest you to create a Droplet on DigitalOcean, a great cloud infrastructure provider. Please note that this tutorial isn’t suitable for production blogs, you should only follow this guide if you wanna try Ghost for a while.


$ apt-get update
$ apt-get upgrade
$ apt-get install g++ make python python-software-properties
$ add-apt-repository ppa:chris-lea/node.js
$ apt-get update
$ apt-get install nodejs
$ cd
$ wget https://ghost.org/zip/ghost-latest.zip
$ unzip ghost-latest.zip -d ghost
$ cd ghost
$ npm install --production

These Bash commands will download the latest Ghost build zip archive to your home directory, unzip it, download and install required npm dependencies inside the Ghost directory.

Next, do the following:

$ cp config.example.js config.js

Open config.js with your favorite editor, you will see this code section twice:

server: {  
host: '127.0.0.1',
port: '2368'
}

Please change them to the following, once again, there are two same code sections to change.

server: {  
host: '0.0.0.0',
port: '80'
}

This will make Ghost HTTP server serve at 0.0.0.0:80 so you will be able to directly connect to http://YOUR-DROPLET-IP-ADDRESS to access your blog.

The last command, launching Ghost:

$ npm start

Okay! You should now able to access your blog at http://YOUR-DROPLET-IP-ADDRESS.

Notice that if Ghost is into an error, it will stop running. To avoid this, use Forever or Supervisor. Here I recommend Forever as it’s quite convenient.

Install Forever:

$ npm i -g forever

Then:

$ cd ~/ghost
$ forever start index.js

You can watch your Ghost log stream with this:

$ forever logs -f 0

Enjoy. Again, don’t follow this tutorial if you are in production. You should at least serve Ghost with, for example, Nginx, in case.