How to install Jekyll from binaries?

packager
Jekyll is one of the most popular static site generation tool. It's getting into the mainstream, Github uses it extensively at Github Pages. It makes blogging really simple, but unfortunately, setting up a self-hosted Jekyll environment is not that easy. To overcome this, I maintain a Jekyll binary repo at packager.io, and here you find my intro how to install and update Jekyll from binaries, on Debian and Ubuntu.

Install Jekyll as gem

Jekyll runs on Ruby, and has its Ruby gem. So installing Jekyll on operating systems, where Ruby comes preinstalled, like OSX or Debian, is as simple as:

sudo gem install jekyll  

Yes, it's simple in some cases. But if Ruby version you have is outdated, or not supported by Jekyll, then the pain starts. You'll need command line tools and compilers to update Ruby from source, or you'll need to install one of the Ruby version managers.

Anyway, some good guides on this way:

At the end, you’ll will have some compilers, source codes and other developer files on your box around.

Use Jekyll binaries

An alternative is to install and update Jekyll from precompiled binaries.

But where are the Jekyll binaries?

Hence, there are some good attempts, too, even they are not well documented or not build in a transparent way:

Build Jekyll binary with packager.io

Packager.io is a service, to build and package Ruby, NodeJS and GO applications, directly from Github. Packager.io is where GitLab also gets packaged.

Since Jekyll is just a Ruby app, we can package it on packager.io!

I simply forked the Jekyll source on Github, added or modified few files, as required by the packager.io service, and than the Jekyll binary packages are build and are here for download, for Debian 7 and Ubuntu 14.04.

First some of my Jekyll binary packages on Debian:

You'll find the install commands at the install button, but here you are the steps to install Jekyll v2.5.3 binary on Debian Wheezy, with Ruby 2.2.0:

# add repository key
wget -qO - https://deb.packager.io/key | sudo apt-key add -

# create apt source file
echo "deb https://deb.packager.io/gh/dxhost/jekyll-bin wheezy v2.5.3-ruby2.2.0" | sudo tee /etc/apt/sources.list.d/jekyll-bin.list

# update and install
sudo apt-get update && sudo apt-get install jekyll-bin  

Updating Jekyll (and Ruby) now is as simple as:

sudo apt-get update  

How to use jekyll-bin

jekyll-bin is installed into /opt/jekyll-bin, including Ruby and all the gems. It deploys also a jekyll user, with a home directory at /home/jekyll-bin, as well as some config files at /etc/jekyll-bin and /etc/default/jekyll-bin. Log files are at /var/log/jekyll-bin.

To use Jekyll, you'll need 2-3 commands, like create new site, (re)build the site, and serve it to the browsers or to the public.

It's worth to read the documentation at packager.io.

The installed jekyl-bin can serve up to 5 Jekyll sites parallel, at ports from 6000 to 6004. It can be even more by adding more line to Procfile, so feedback please!

To create a new Jekyll site, you have to create and set the site home as variable, generate the site, and serve it to a HTTP port.

jekyll-bin config set SITE1=/home/jekyll-bin/first-site  
jekyll-bin new1  
jekyll-bin serve1  

The 5 sites (SITE1 to SITE5) are served at ports 6000-6004, respectively. Also updates in source or new posts are picked up and a build is run automatically.

Just do not forget to set the SITE variables upfront!

Happy jekylling!