Skip to content

Deploying a Jekyll Site

Jekyll is a simple, blog-aware static site generator for personal, project, or organization sites. Written in Ruby, it transforms Markdown and Liquid templates into static websites, making it a popular choice for blogs and documentation.

This guide explains how to deploy a Jekyll application to Klutch.sh, both with and without a Dockerfile. It covers installation, sample code, and deployment steps.

Prerequisites


Getting Started: Create a Jekyll Site

  1. Install Jekyll and Bundler:
    Terminal window
    gem install jekyll bundler
  2. Create a new Jekyll site:
    Terminal window
    jekyll new my-jekyll-site
    cd my-jekyll-site
  3. Start the development server:
    Terminal window
    bundle exec jekyll serve
    Your site should be running at http://localhost:4000.

Sample Code (_posts/2025-07-29-hello-klutch.md)

Create a sample post:

---
title: "Hello from Jekyll on Klutch.sh!"
date: 2025-07-29
---
Welcome to your Jekyll site deployed on Klutch.sh!

Deploying Without a Dockerfile

Jekyll sites are static after build. Klutch.sh can deploy static sites directly.

  1. Push your Jekyll site to a GitHub repository.
  2. Log in to Klutch.sh.
  3. Create a new project.
  4. Create a new app:
    • Select your Jekyll GitHub repository and branch
    • Choose “Static Site” as the app type
    • Set build command: bundle exec jekyll build
    • Set output directory: _site
    • Configure region, compute, and environment variables as needed
  5. Click “Create” to deploy. Klutch.sh will build and serve your static Jekyll site.

Deploying With a Dockerfile

If you need custom server logic or want to use a Dockerfile:

  1. Add a Dockerfile to your project root. Example:
    # Build stage
    FROM ruby:3.3-alpine AS builder
    WORKDIR /site
    COPY . .
    RUN gem install jekyll bundler && bundle install && bundle exec jekyll build
    # Production stage
    FROM nginx:alpine
    COPY --from=builder /site/_site /usr/share/nginx/html
    EXPOSE 80
    CMD ["nginx", "-g", "daemon off;"]
  2. Push your code (with Dockerfile) to GitHub.
  3. In Klutch.sh, create a new app and select the Dockerfile option when prompted.
  4. Set service details and environment variables as needed.
  5. Click “Create” to deploy. Klutch.sh will build your Docker image and serve your Jekyll site via Nginx.

Resources


Deploying Jekyll to Klutch.sh is fast and flexible. Use static site deployment for most cases, or Dockerfile for custom setups.