How To Install Ghost From The GitHub Repository Source Code


If you want to install the most up-to-date version Ghost from source code instead of waiting for an official Ghost release you can grab the source code from GitHub. The following steps will walk through how to install git and how to install Ghost from Ghost's GitHub repository.

Prerequisites

CentOS

If you are running on CentOS you will need the following:

sudo yum install git ruby rubygems
sudo gem install sass bourbon bundler

Ubuntu

If you are running on Ubuntu you will need the following:

apt-get install git ruby rubygems
sudo gem install sass bourbon bundler

Download and Install Node.js

Go to nodejs.org and download the latest version of the .tar.gz

cd /tmp/
wget http://nodejs.org/dist/node-latest.tar.gz
tar -zxvf [name_of_node}.tar.gz
cd [name_of_node]/

Install node

./configure
make
sudo make install

Clone Ghost GitHub Repository

Next you need to add your ssh keys to your GitHub account (If you do not have a GitHub account head over to the GitHub signup page to). You can check if you already ssh keys by running ls ~/.ssh/. If you see idrsa and idrsa.pub then you already have your ssh keys. Otherwise you can use this GitHub article to create your keys and then add them to your GitHub account.

Next you can prepare the directory that Ghost will be cloned into and clone the repository:

sudo mkdir -p /var/www
cd /var/www/
sudo git clone https://www.github.com/TryGhost/Ghost.git ghost
cd ghost/
git submodule update --init
npm install -g grunt-cli
npm install
grunt init

Ghost is now installed and has the master branch checked out. The master branch is the bleeding edge where all the development happens. If your desire is to run a production blog I would not recommending using the master branch. Instead it would be wise to checkout the latest release tag. To do that first check what the latest tag is by running:

 git tag

That will show you all of the tags that the Ghost developers have created. Then to checkout a tag run:

 git checkout [tag]  

You can checkout this article for details on the last configurations steps needed before running npm start.