Setup Octopress Blog and Deploy to Heroku

written in Blogging, Heroku, Octopress

Initial Setup

I created this blog site with octopress. Formerly, I was using blogspot but I want to change a flexible platform like jekyll based octopress. Here is how I setup this blog site from scratch.

Install Git

Firstly, you must have to install git

Install RVM, Ruby and Bundler

You must run the following command for installing rvm

curl -L https://get.rvm.io | bash -s stable --ruby

After the rmv install properly, we need to install ruby

rvm install 2.1.1
rvm use 2.1.1 --default
rvm rubygems latest

Install Bundler gem

gem install bundler

Install Octopress

We will clone the repository and make our changes directly in the octopress source codes.

git clone git://github.com/imathis/octopress.git octopress
cd octopress

Inside the project, you must run bundle for installing dependencies of octopress gem.

bundle

Deploying to Heroku

You must install heroku gem first

gem install heroku

You must have a heroku account. After the sign in you can open a new app from heroku dashboard

Now, you must add a remote address to your project. For that purpose, go to settings page of your app

https://dashboard.heroku.com/apps/yourapp/settings

Copy the Git Url of your app and run the following command

git remote add heroku git@heroku.com:yourapp.git

Edit the .gitignore in the root of your repository and remove public. This will let you add generated content for deploying it to Heroku.

Let’s build the static contents and deploy them to heroku

rake generate
git commit -am "initial commit"
git push heroku master

Now you can view your blog site from yourapp.herokuapp.com

Customize Theme

I does note like the default theme of octopress and want to switch another theme. Here you can find a list of available themes. This blog uses Slash theme.

We must clone theme from the repository and install to our blog

cd octopress
git clone git://github.com/tommy351/Octopress-Theme-Slash.git .themes/slash
rake install['slash']                   # if you are using zsh you must install like this rake install\['slash'\]
rake generate

Of course after these changes, you must commit and push your works to heroku.

Now you have a running blog site. You can find the detailed information of how to write your first blog post from octopress-blogging and jekyll-writing posts

Good luck!