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/.