Ghost is a blog platform that was based Nodejs thus require special environment to run. And, not all hosting providers primarily provide shared hosting environemnt for Nodejs. We can install and use for free Ghost in OpenShift. OpenShift is a PaaS service that provides a free service with a maximum limit of 3 gears and 1GB of storage per gear.
Step 01 - Create an Account
You need create an account to use OpenShift service. Visit their website here to create an account.
Step 02 - Install rhc and git
You must install Ruby and Git on your PC. On Linux distro you can use RVM, execute this command on your terminal:
curl -L https://get.rvm.io | bash -s stable --ruby=2.1.0 source ~/.rvm/scripts/rvm rvm info
Debian based distros:
apt-get update; apt-get install git-core
RedHat based distros:
yum update; yum install git
Arch Linux based distro:
pacman -Sy; pacman -S git
If you use Windows you can install from RubyInstaller and mSysGit. Please read the documentation to install it.
Now you have Ruby environment on your system. Next step is installing
rhc tool. This is utility for managing your OpenShift Application. Open terminal or command prompt and execute this command:
gem update gem install rhc
Then, connect your OpenShift account:
Follow the wizard. If you asked for uploading ssh public key answer yes.
Step 03 - Create OpenShift Gear
Now time to create your Ghost application. Follow this command:
rhc app create ghost nodejs-0.10 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
This will create a new gear. Or, if you want to use Ghost with MySQL as database backend use this command:
rhc app create ghost nodejs-0.10 mysql-5.1 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-mysql-quickstart.git
And add phpMyAdmin:
rhc cartridge add -a ghost -c phpmyadmin-4
Step 04 - Login to Ghost
To access your blog using the URL address given. Example:
http://ghost-ospian.rhcloud.com. To login use this URL:
http://ghost-ospian.rhcloud.com/ghost. Don't forget to change the domain with yours.
I want to use custom domain, how?
Login to OpenShift control panel and add or edit alias for your Ghost app, then add CNAME DNS record at your DNS server point to your Ghost address.
That's all. Next time I will explain how to add Ghost themes on OpenShift. If you have questions please write at comments at bottom of this page.