Tired of waiting 1–2 minutes every time you make a change just to see if it worked? Want to preview your site instantly on your own computer before publishing changes to your public site on GitHub?
A widespread app called Docker lets you run your entire website on your computer, so you can see changes immediately. Make an edit, save the file, refresh your browser. No pushing changes and waiting for GitHub Pages to rebuild your site.
This guide shows you how to set up local development using Docker, even if you’ve never heard of it before.
The issue: Every time you push changes to GitHub, you wait while GitHub Pages rebuilds your site. If you made a typo or something doesn’t look right, you have to fix it, push again, and wait again.
The solution: Docker runs Jekyll (the software that builds your site on GitHub Pages) directly on your computer. You see changes instantly in your browser—no pushing, no waiting, no surprises with your live site.
Think of Docker as: A self-contained mini-computer that already has everything set up to run your site. You don’t need to install Ruby, Jekyll, or any complicated dependencies. Docker handles all that.
Docker Desktop is the app that makes this all work.
.dmg file and drag Docker to your Applications folderYou’ll need to use the terminal (Mac/Linux) or command prompt (Windows) to run Docker commands.
Command + Space to open SpotlightYou need to “go into” your website folder using the terminal. Here’s how:
cd (that’s “cd” followed by a space—don’t press Enter yet!)cd Example of what you’ll see:
cd /Users/yourname/Documents/my-site
How to tell it’s working: Your terminal prompt should now show your site folder name.
Now for the magic! Copy and paste this command into your terminal and press Enter:
docker run --rm -it -p 4000:4000 -v "$(pwd):/srv/jekyll" jekyll/jekyll:4.2.0 jekyll serve --force_polling --livereload
What this command does (you don’t need to memorize this):
docker run - Tells Docker to run a containerjekyll/jekyll:4.2.0 - Uses the official Jekyll Docker image-p 4000:4000 - Makes your site available at localhost:4000-v "$(pwd):/srv/jekyll" - Connects your site folder to the containerjekyll serve - Runs the Jekyll server--force_polling - Watches for file changes on your computer--livereload - Automatically refreshes your browser when files changeFirst time running? Docker will download the Jekyll image (about 200MB). This takes a few minutes but only happens once.
What you’ll see:
Server address: http://0.0.0.0:4000/
Server running... press ctrl-c to stop.
When you see this, your site is ready!
http://localhost:4000Now the real power: Make a change to any file, save it, and watch your browser automatically refresh with the changes. No waiting!
Once you have Docker installed, here’s your typical workflow to edit your site:
cd /path/to/your/sitedocker run --rm -it -p 4000:4000 -v "$(pwd):/srv/jekyll" jekyll/jekyll:4.2.0 jekyll serve --force_polling --livereload
http://localhost:4000Ctrl + C in the terminal to stop the serverThat Docker command is long! Save it in a text file so you can copy/paste it easily. Or better yet, create a file called start-site.sh (Mac/Linux) or start-site.bat (Windows) with the command inside, and just run that file.
Fix: Make sure Docker Desktop is open and running. Look for the whale icon in your menu bar/system tray.
Fix: You probably already have Jekyll running. Either:
-p 4000:4000 to -p 4001:4000 and visit http://localhost:4001Fix (Mac/Linux): Try adding sudo before the command:
sudo docker run --rm -it -p 4000:4000 -v "$(pwd):/srv/jekyll" jekyll/jekyll:4.2.0 jekyll serve --force_polling --livereload
Fix (Windows): Make sure Docker Desktop is running and you’ve restarted your computer after installation.
Fix: The --livereload flag should handle this, but if it doesn’t work:
--force_polling --livereloadFix:
Ctrl + Shift + R (Windows/Linux) or Cmd + Shift + R (Mac)Fix: Make sure you’re in the correct folder. Type ls (Mac/Linux) or dir (Windows) and you should see folders like _layouts, assets, guides, etc. If not, navigate to the correct folder using cd.
See changes immediately—no waiting for GitHub Pages to rebuild (which takes 2-3 minutes each time).
If something breaks, you’ll see it locally before your live site is affected. No more pushing broken code!
Once Docker has downloaded the Jekyll image, you can work without internet. Only connect when you’re ready to push changes to GitHub.
When making big changes (new layouts, CSS refactoring, etc.), you can experiment freely and make sure everything works before going live.
Error messages appear immediately in your terminal, making it much easier to figure out what went wrong.
Use local development when:
Stick with GitHub editing when:
Now that you have local development working:
What we did:
localhost:4000The command to remember:
docker run --rm -it -p 4000:4000 -v "$(pwd):/srv/jekyll" jekyll/jekyll:4.2.0 jekyll serve --force_polling --livereload
The workflow:
You now have a professional development workflow that makes building your site much faster and more enjoyable!