Getting Ghost Running on Github (with Buster)

I thought it would be fitting to start off my first blog post explaining to those starting out how I actually got Ghost up and running.

There were a few blogs out there that suggested to use the Quick Install method. However, at some quick first attempts I encountered a number of issues (mostly revolving around Buster and its generate command failing after trying to fix links:
fixing links in /Users/<user>/Development/Node/ghost-0.7.8/static/index.html)

So I decided to do what any sane developer would do and to clone the entire repo (which will also come in handy when I have time to contribute to the project anyway).


Getting Started

Make sure you have Node.js installed prior to doing any of the following.
I cloned the repo in a folder of my choosing (renaming it 'Ghost') and then entered it:

git clone https://github.com/TryGhost/Ghost.git "Ghost"
cd ghost

Next, install the Grunt CLI globally if you haven't already:

npm install -g grunt-cli

Time to install Ghost itself:

npm install

And wait...
Since we are going to be deploying for production we want to use the stable branch:

git checkout stable

Next we build and minify for production:

grunt init
grunt prod

Some more waiting while it spins... go read a book or something productive.
When it is done we can finally run a local server to see if everything is running smoothly!

npm start

Navigating to www.alekseev.ca/blog/ in your browser, you should see
First run


Setting up your Blog

When you navigate to www.alekseev.ca/blog/ghost you will be taken through a setup process for your blog.
Make an account and when the process is finished you will see the admin screen:
Admin screen

As you can see it is simple and intuitive to understand, unlike some other blogging platforms that tend to overcomplicate matters.

Feel free to customize it to your liking. Add your logo and a background. You can change themes later (instructions below) or even create your very own.


First Deploy with Buster

Firstly, you want to create a new Github repo named <your-user-name>.github.io

Secondly you want to make sure pip is installed on your system:

easy_install pip

Use pip to install Buster:

pip install buster

cd into your Ghost repo. We need to link Buster to your github repo and create that static folder:

buster setup
https://github.com/<username>/<username>.github.io.git

Since Buster generates static files from a local server, we need to make sure the server is running:

npm start

and in a separate terminal window (in the same Ghost directory) run:

buster generate --domain=www.alekseev.ca/blog/

This will generate static files from a local running server and places them inside a static folder from where the command was called.

One last step! You need to push it up to github in one of two ways:

buster deploy

OR (like most sane people would do)

cd static
git add .
git commit -m "first commit"
git push origin master

Check <your-user-name>.github.io to make sure it deployed correctly!


Blog Workflow

  1. If it is not already obvious, you need to run your local server with npm start and navigate to www.alekseev.ca/blog/ghost
  2. Click new post and add your . When you're finished markdown and click "Publish now" on the top right corner
  3. Use the buster generate --domain=www.alekseev.ca/blog/ command above to rebuild your updated static folder
  4. Deploy to github:
    • buster deploy
    • or cd static/ and push it up to your remote on github normally.
      Remember you need to have your local server running in the background before you use buster generate
  5. Pray someone actually reads it. Or you can spam it all over social networks and piss people off with your wise-cracks. Your choice.

Customize

  1. Find a theme http://marketplace.ghost.org/themes/free/ and its Github repo
  2. cd <path>/Ghost/content/themes
  3. git clone <repo-of-theme> "<name-of-theme>"
    • Example: git clone https://github.com/oswaldoacauan/ghostium/ "ghostium"
  4. cd ../.. (Back to your Ghost root directory)
  5. npm start (Run your server)
  6. Go to www.alekseev.ca/blog/ghost/settings/general/ and select the newly installed theme from the drop down. Restart the server and you will see it.
  7. Dance!

Some themes have more configuration options than others. Such as Google Analytics, Disqus, etc.

Of course even if it doesn't you can add it yourself cause you're a smart cookie. Enjoy!