Link Search Menu Expand Document

Install Jekyll on a Raspberry Pi

Set up your Raspberry Pi to host a static website using Jekyll, the same software used to run this website!

Table of contents

  1. What is Jekyll
  2. Installing Jekyll
  3. Running and updating the website

What is Jekyll

There are many ways to host a website on your Raspberry Pi, of which I think Jekyll (jekyllrb.com) is one of the best solutions. Jekyll is a static site generator that specifically helps to render Markdown and template files into a complete static website. Jekyll was also used to create this website, hosted from a Github repository using Github Pages.

Installing Jekyll

First we will install Ruby, which is a package manager that we use to install jekyll:

sudo apt-get update
sudo apt-get install software-properties-common -y
sudo apt-get install ruby-full -y

Next, to install jekyll, use the following commands:

sudo gem install jekyll
sudo gem install bundler

Now navigate to the folder where you want your website (folder) to reside, e.g.:

mkdir /home/pi/websites
cd /home/pi/websites

Run the following command to set up a new jekyll website:

jekyll new websitename

A new folder with the name you provided will be created with all the basic files you will need for your website.

Running and updating the website

To run the wesbite, navigate into its folder, e.g.:

cd websitename

Now to serve the website at http://localhost:4000, enter:

bundler exec jekyll serve 2>/dev/null

This will continuously update your website while you edit files. Read more about how to create a jekyll website here.

Your website will be hosted locally but with some extra steps it is also possible to serve the website to the broader internet, such as by using ngrok.


Comments

Add a Comment


If you use find any of the information provided on this website useful it would be great to hear from you and please consider citing the paper! All rights reserved © 2021 Jolle Jolles. Website built using Jekyll and the Just the Docs theme.