---
title: "How to deploy jekyll site to heroku"
description: "This blog discusses how to deploy jekyll site to heroku"
canonical_url: "https://www.bigbinary.com/blog/deploy-jekyll-to-heroku"
markdown_url: "https://www.bigbinary.com/blog/deploy-jekyll-to-heroku.md"
---

# How to deploy jekyll site to heroku

This blog discusses how to deploy jekyll site to heroku

- Author: Neeraj Singh
- Published: April 27, 2014
- Categories: Ruby

[jekyll](http://jekyllrb.com) is an excellent tool for creating static pages and
blogs. Our [BigBinary blog](https://bigbinary.com/blog) is based on jekyll.
Deploying our blog to heroku took longer than I had expected. I am outlining
what I did to deploy [BigBinary blog](https://bigbinary.com/blog) to heroku.

## Add exclude vendor to \_config.yml

Open `_config.yml` and add following line at the very bottom.

```ruby

exclude: ['vendor']

```

## Add Procfile

Create a new file called `Procfile` at the root of the project with following
content.

```ruby

web: bundle exec jekyll build && bundle exec thin start -p\$PORT -V
console: echo console
rake: echo rake

```

## Add Gemfile

Add `Gemfile` at the root of the project.

```ruby

source 'https://rubygems.org'

gem 'jekyll', '2.4.0'
gem 'rake'
gem 'foreman'
gem 'thin'
gem 'rack-contrib'

```

## Add config.ru

Add `config.ru` at the root of the project with following content.

```ruby

require 'rack/contrib/try_static'

use Rack::TryStatic,
:root => "\_site",
:urls => %w[/],
:try => ['.html', 'index.html', '/index.html']

run lambda { |env|
return [404, {'Content-Type' => 'text/html'}, ['Not Found']]
}

```

## Test on local machine first

Test locally by executing `bundle exec jekyll serve`.

## Push code to heroku

Now run _bundle install_ and add the _Gemfile.lock_ to the repository and push
the repository to heroku.

## Links

- [Human page](https://www.bigbinary.com/blog/deploy-jekyll-to-heroku)
