Deploying Octopress to Github Pages and Custom Domain

Posted by Lawrence Sun on 2013-12-20

After Set up Octopress blog, I tried to deploying it to my own subdomain.

First, create a new Github repository called “”. e.g. I created a new repo “”.

Then run:

rake setup_github_pages

Copy URL of this new repo.

Next run:

rake generate
rake deploy

Run rake preview to see the blog at localhost:4000

Commit to source branch:

git add .
git commit -m "message"
git push origin source

Octopress blog could be seen through few minutes later.

If you want to deploy it to your own domain like me,
create a new CNAME record in domain name server.

e.g. I went to DNS manage in the Godaddy, and added voice as the name, CNAME as the type and as the value.

When typing in the new subdomain(in my case,, it will point to a Github 404.

Then run this to create a CNAME file in source directory:

echo '_yourdomain.com_(e.g.' >> source/CNAME

Finally, run rake generate and rake deploy and git commit as well.