Software Engineer · Teacher · Author · Vegan

Running a Jekyll Site with Docker

Last reviewed on January 24, 2020

1. Install Docker Desktop

Install Docker Desktop and start it up.

2. Create docker-compose.yml

Create a docker-compose.yml file in the root of your Jekyll project with the following contents:

jekyll:
  image: jekyll/jekyll:pages
  command: jekyll serve --watch --incremental
  ports:
    - 4000:4000
  volumes:
    - .:/srv/jekyll

3. Run your Jekyll Site

Run docker-compose up from the root of your project. This will run the jekyll command you’re probably familiar with and generate your site which can be viewed at http://localhost:4000/.

Disclaimer: Any viewpoints and opinions expressed in this article are those of David Tang and do not reflect those of my employer or any of my colleagues.