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
- Ruby installed (Download)
- Jekyll installed (Install guide)
- Git and GitHub account
- Klutch.sh account
Getting Started: Create a Jekyll Site
- Install Jekyll and Bundler:
Terminal window gem install jekyll bundler - Create a new Jekyll site:
Terminal window jekyll new my-jekyll-sitecd my-jekyll-site - Start the development server:
Your site should be running at http://localhost:4000.
Terminal window bundle exec jekyll serve
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.
- Push your Jekyll site to a GitHub repository.
- Log in to Klutch.sh.
- Create a new project.
- 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
- 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:
- Add a
Dockerfile
to your project root. Example:# Build stageFROM ruby:3.3-alpine AS builderWORKDIR /siteCOPY . .RUN gem install jekyll bundler && bundle install && bundle exec jekyll build# Production stageFROM nginx:alpineCOPY --from=builder /site/_site /usr/share/nginx/htmlEXPOSE 80CMD ["nginx", "-g", "daemon off;"] - Push your code (with Dockerfile) to GitHub.
- In Klutch.sh, create a new app and select the Dockerfile option when prompted.
- Set service details and environment variables as needed.
- 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.