Jekyll is a static site generator written in Ruby. It takes plain text files – Markdown, HTML, Liquid templates – and builds a complete static website that you can host anywhere. Jekyll powers GitHub Pages, making it one of the most popular choices for developer blogs, documentation sites, and project pages. There is no database, no server-side processing, and no security patches to worry about. You write content in Markdown, run a build command, and get a folder of HTML files ready to deploy.
In this guide, I will show you how to install Jekyll on Ubuntu 24.04 LTS (Noble Numbat), create a new site, customize it, write posts, and deploy it to production. Whether you are hosting on GitHub Pages, a VPS with Nginx, or Cloudflare Pages, this tutorial covers the full workflow.
Prerequisites
- Ubuntu 24.04 LTS server or desktop
- A user account with sudo privileges
- At least 1 GB of RAM (2 GB recommended for larger sites)
- Internet connectivity
Step 1: Update System Packages
Start by updating your package index and upgrading installed packages:
sudo apt update && sudo apt upgrade -y
Step 2: Install Ruby
Jekyll requires Ruby 3.0 or newer. Ubuntu 24.04 ships with Ruby 3.2 in its repositories, which works well.
Option A: Install Ruby from APT (Simple)
This is the fastest method and works for most use cases:
sudo apt install -y ruby-full build-essential zlib1g-dev
Set up gem installation paths so you do not need root privileges to install gems. Add these lines to your ~/.bashrc:
echo '# Ruby Gems path' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Option B: Install Ruby with rbenv (Flexible)
If you need a specific Ruby version or manage multiple Ruby versions, rbenv is the better choice:
sudo apt install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libffi-dev libgdbm-dev libncurses5-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
Install Ruby 3.3 (or the latest stable version):
rbenv install 3.3.6
rbenv global 3.3.6
Verify the Ruby installation regardless of which method you chose:
ruby --version
gem --version
You should see Ruby 3.2 or newer in the output.
Step 3: Install Jekyll and Bundler
Jekyll is distributed as a Ruby gem. Bundler manages gem dependencies for your project. Install both:
gem install jekyll bundler
Verify the installation:
jekyll --version
Expected output:
jekyll 4.3.4
Step 4: Create a New Jekyll Site
Generate a new Jekyll site with the default theme (Minima):
jekyll new mysite
cd mysite
Install the gem dependencies listed in the generated Gemfile:
bundle install
Step 5: Serve the Site Locally
Start the built-in development server:
bundle exec jekyll serve
Open your browser and visit http://localhost:4000. You should see the default Jekyll site with a welcome post.
To make the server accessible from other machines on the network, bind it to all interfaces:
bundle exec jekyll serve --host 0.0.0.0
For development, add the --livereload flag to automatically refresh your browser when you save changes:
bundle exec jekyll serve --livereload
Step 6: Understand the Directory Structure
A Jekyll site follows a specific directory layout. Here is what each part does:
mysite/
_config.yml # Site configuration (title, URL, theme, plugins)
_posts/ # Blog posts in Markdown (YYYY-MM-DD-title.md)
_layouts/ # HTML templates that wrap your content
_includes/ # Reusable HTML snippets (header, footer, nav)
_sass/ # Sass stylesheets
_site/ # Generated static site (output - do not edit)
assets/ # Static files (CSS, JS, images)
Gemfile # Ruby gem dependencies
index.md # Homepage content
404.html # Custom 404 page
The _site/ directory contains the final generated HTML. This is what you deploy to your web server. Never edit files inside _site/ directly because they get overwritten on every build.
Step 7: Configure Your Site
Edit _config.yml to set your site details:
title: My Tech Blog
description: Notes on Linux, DevOps, and infrastructure
url: "https://example.com"
baseurl: ""
author:
name: Your Name
email: [email protected]
# Build settings
theme: minima
plugins:
- jekyll-feed
- jekyll-seo-tag
- jekyll-sitemap
# Permalink structure
permalink: /:title/
# Markdown processor
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
After editing _config.yml, you must restart the Jekyll server for changes to take effect. The live reload feature does not pick up config changes.
Step 8: Write Blog Posts
Jekyll blog posts live in the _posts/ directory. Each post must follow this naming convention:
YYYY-MM-DD-title-of-post.md
Create a new post:
nano _posts/2026-03-18-getting-started-with-jekyll.md
Every post starts with YAML front matter between triple dashes, followed by your Markdown content:
---
layout: post
title: "Getting Started with Jekyll"
date: 2026-03-18 10:00:00 +0000
categories: [tutorials, web]
tags: [jekyll, static-site, ruby]
---
This is my first Jekyll blog post. You can write in **Markdown**
and Jekyll converts it to HTML.
## Adding Code Blocks
```bash
sudo apt update
echo "Hello from Jekyll"
```
## Adding Images

Draft posts that are not ready for publishing can go in a _drafts/ folder without the date prefix. Preview drafts with:
bundle exec jekyll serve --drafts
Step 9: Customize Themes
The default Minima theme is clean but basic. You can switch to a different gem-based theme or build your own.
To use a different theme, add it to your Gemfile:
gem "jekyll-theme-chirpy"
Then run:
bundle install
Update _config.yml:
theme: jekyll-theme-chirpy
To override specific parts of any theme, copy the relevant file from the theme gem into your site. For example, to customize the header layout:
bundle info --path minima
Copy the file you want to modify from that path into your project’s _includes/ or _layouts/ directory. Your local copy takes precedence over the theme’s version.
Step 10: Build for Production
When you are ready to deploy, build the site with the production environment variable:
JEKYLL_ENV=production bundle exec jekyll build
This generates the final site in the _site/ directory with production-specific settings (analytics, minification if configured, canonical URLs).
Verify the build succeeded:
ls -la _site/
Step 11: Deploy Your Jekyll Site
Deploy to GitHub Pages
GitHub Pages has built-in Jekyll support. Push your source code to a GitHub repository:
cd mysite
git init
git add .
git commit -m "Initial Jekyll site"
git branch -M main
git remote add origin https://github.com/yourusername/yourusername.github.io.git
git push -u origin main
In your repository settings on GitHub, go to Pages and select the main branch as the source. Your site will be live at https://yourusername.github.io within a few minutes.
Deploy to Nginx
If you host on your own VPS, copy the _site/ contents to your Nginx web root:
sudo apt install -y nginx
sudo cp -r _site/* /var/www/html/
Create an Nginx configuration for your site:
sudo nano /etc/nginx/sites-available/jekyll
Add the following server block:
server {
listen 80;
server_name example.com www.example.com;
root /var/www/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
}
Enable the site and restart Nginx:
sudo ln -s /etc/nginx/sites-available/jekyll /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Deploy to Cloudflare Pages
Cloudflare Pages can build and deploy Jekyll sites directly from your Git repository. In the Cloudflare dashboard:
- Go to Workers and Pages and select Create application
- Connect your GitHub or GitLab repository
- Set the build command to
jekyll build - Set the output directory to
_site - Add the environment variable
JEKYLL_ENV=production
Cloudflare handles the rest – SSL, CDN, and automatic deployments on every push.
Troubleshooting
Bundler version mismatch: If you see errors about Bundler versions, update it with gem install bundler and run bundle update --bundler.
Missing gems after Ruby upgrade: After upgrading Ruby, run gem install jekyll bundler again and bundle install in your project directory.
Port 4000 already in use: Use a different port with bundle exec jekyll serve --port 4001.
Slow build times: For large sites with hundreds of posts, enable incremental builds with bundle exec jekyll serve --incremental.
Conclusion
You have a working Jekyll installation on Ubuntu 24.04 and the knowledge to create, customize, and deploy a static site. Jekyll remains one of the most straightforward static site generators available – it does not try to do everything, and that simplicity is its strength. For blogs, documentation, and project pages, it handles the job well. If you need more dynamic features later, look into Jekyll plugins or consider a headless CMS like Decap CMS (formerly Netlify CMS) that integrates with Jekyll through Git-based workflows.