Setting Up Ghost on OpenShift using OS X


DEPRECATED - Red Hat has retired OpenShift v2###

The silver plan, paid by use, has been replaced with a $50/month pro tier. Now I'm using Heroku, whose paid plans start at $7 US/month.

Using OS X 10.9.1.

Insert your own values for **CAPITALS**.

###Initial Setup###
  • Sign up with

  • Install Xcode.

  • Install Git for OS X.

  • [Note] Press Ctrl+Click to open installers rejected by OS X 10.9 (Mavericks). This happens for anything outside their App Store and approved developer list. It can be disabled from System Preferences > Security & Privacy.

  • Install RHC using RubyGem using Terminal. There will be a prompt for admin access, then wait a minute.

sudo gem install rhc
  • Setup RHC. Enter the OpenShift login from earlier, accept the defaults and pick a unique RHC namespace.
rhc setup
  • Open Xcode, accept the terms of service, then quit. (Accepting from the terminal (w/ 'sudo git') failed for me, but YMMV.)

  • Set some git defaults.

git config --global "****"
git config --global "**YOUR_NAME**"
git config --global push.default simple
  • Verify Ruby and Git have installed properly.
ruby -e 'puts "Welcome to Ruby"'
git --version
  • Remember to update RHC from time to time
gem update rhc
  • Create the Ghost application. Pick a meaningful name.
rhc app create **APP_NAME** nodejs-0.10 --env NODE_ENV=production --from-code

###Troubleshooting the Setup###
  • The first time this is done the authenticity of your site likely can't be established, so just type 'yes' when prompted. If setup get stuck after this, press Ctrl+C and clone the git repository manually.
rhc git-clone **APP_NAME**
  • If you don't make it that far or want to start fresh, delete the application and free up that app name.
rhc app-delete **APP_NAME** --confirm

###Working with Git and RHC###
  • Navigate into the new directory. Edit the files there manually.
cd **APP_NAME**
  • To see info about your app type the following.
rhc show-app **APP_NAME**
  • Update and push out changes like this.
git add --all .
git commit -m 'My changes'
git push
  • Then restart the app to put those changes into effect.
rhc app restart
  • Don't forget to take regular snapshots!
rhc save-snapshot

###Configuring Ghost###
  • Login to your new blog from the following link.

    • Create an administrator account on the first login. If something goes wrong restart the app and try again.
    • The rest is fairly straightfordward, so you can take it from here.

  • [OPTIONAL] Provide a Gmail account for sending password resets.
    • Edit config.js, but be warned this is not secure!
    • After this is done update git and restart the app.
        url: 'http://**YOUR_SITE_ADDRESS**,
        mail: {
                transport: 'SMTP',
                options: {
                        service: 'Gmail',
                        auth: {
                                user: '**GMAIL@GMAIL.COM',
                                pass: '**PASSWORD**'

###Custom Domain Setup###

Configuring GhostWall Theme###

For details on this this site is configured, please see the link below. Be warned that the theme used costs around $24 US.

That's it!

  • [BONUS] To make running multiple commands simpler I recommend adding aliases to .bashrc, hidden in your home directory.

    Creating Aliases with .bashrc

Many thanks to Andrew Hobden (aka. Hoverbear) for providing just enough taunting/direction to help.