Deploying Jekyll website to Heroku

iRonin IT Team - Experts in software development
devops, heroku, jekyll, deployment

Last time we showed you how to deploy Phoenix application to Heroku. In this article we will show you how to host static website there.

Recently we wanted to setup a staging environment for one of our Jekyll powered websites on Heroku.

It turns out, it’s easy to host Jekyll websites as rack apps with the puma server - so we thought we’d share with you how to do it.

Configuration

Update Gemfile

You need to add the following gems to your Gemfile:

  • rack-jekyll - for transforming your Jekyll app into a rack app
  • rake - for generating pages during deploy (necessary because Heroku provides a read-only filesystem)
  • puma - for serving your rack app

Create Procfile

Heroku uses Procfile for declaring what commands are run on dynos, so we need one as well:

web: bundle exec puma -t 8:32 -w 3 -p $PORT

This basically will start puma with 3 workers and 8-32 threads per worker. You can find all the config options here.

Add config.ru

Since we are going to run a rack app we need config.ru file:

require 'rack/jekyll' require 'yaml'
run Rack::Jekyll.new

Deploy

Now are ready to deploy our app to Heroku:

git push heroku master

Simple, huh? If you have configuration issues that you would like us to handle, then let us take a look at your DevOps setup. We have helped many software companies in the USA and around the world with their systems configuration. Reach out to us at iRonin now!

Author's Bio
iRonin IT Team

Experts in software development

We are a 100% remote team of software development experts, providing web & mobile application development and DevOps services for international clients.

Similar articles
Comments

Bulletproof your development with remote team augmentation

Read how
This page is best viewed in portrait mode
Our websites and web services use cookies. We use cookies and collected data to enhance your experience, provide additional communication channels, improve marketing materials and enhance our offer. IRONIN SP. Z O.O. SP. K. is committed to protecting all the data that we collect or process in any way, especially data of personal nature. By accepting these terms you agree to our usage of cookies and processing your data, according to our Privacy Policy, and you declare that your browser settings reflect your preferences. Read more You have the right to revoke this agreement at any time, based on the terms of our Privacy Policy. You can change cookies settings in your browser. If you do not agree with us using cookies and processing your data, please change your cookies settings in your web browser and reject these terms. You can find more information about cookies, your data privacy This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. data processing, and your rights in our Privacy Policy.