Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Free site with custom domain in 10 minutes with Jekyll & GitHub Pages

Free site with custom domain in 10 minutes with Jekyll & GitHub Pages

YouTube Video
Follow this walk-through in video format

Prerequisites

Install Ruby 3.0 and Jekyll on macOS

In Terminal:

brew install ruby
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(gem env gemdir)/bin:$PATH"' >> ~/.zshrc

Note: Older versions of MacOS use Bash instead of ZSH. If this case, use ~/.bash_profile instead of ~/.zshrc.

Open a new Terminal window! (Close the old one.)

gem install jekyll bundler

Create a GitHub repo as a Jekyll site

In Terminal, in the repo directory:

jekyll new .
bundle add webrick

Test your site locally

In Terminal, in the repo directory:

jekyll serve --livereload

Connect your domain name

In Terminal, in the repo directory:

echo 'mydomain.com' > CNAME

DNS records:

ALIAS Record    @     myusername.github.io.
CNAME Record    www   mydomain.com.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment