← Back

Deploying an Octopress blog from a VPS to NearlyFreeSpeech.net

Author's note: This was migrated from an Octopress blog. I think the data is still relevant to anyone trying to run Octopress and deploy to NearlyFreeSpeech, so I've kept the post online in its old form. Enjoy!

Hello! I'm Matthew Lewis, and this is my Octopress blog.

I'd like to use this blog for projects, and I suppose the first project I should discuss is this blog itself.

Octopress is a blogging framework. It's based on jekyll, a static site generator.

Frankly, Octopress is amazing. It's easy to install and modify themes and layouts, and I can run a single rake command to deploy my blog from my VPS to my NearlyFreeSpeech site.

In this post, I'll detail how to generate and deploy your Octopress blog straight to your NearlyFreeSpeech.net hosting account in one command.

Deployment Stack

I'm running on a Debian 32-bit VPS hosted on BigScoots and hosting www.mplewis.com on NearlyFreeSpeech.net.

Why use a VPS and a web host?

I want to host my blog on NFS.net because:

  • NFS can handle much more traffic than my dev VPS (my VPS is uber cheap)
  • NFS is seriously cheap for static sites, which makes using Octopress on NFS very attractive

I have to use a VPS to deploy because:

  • NFS doesn't have the proper Ruby or bundles or anything I need to generate my Octopress site using Jekyll

So, how's the deploy work?

The process behind deploying an Octopress blog is as follows:

  • Run rake generate to generate the static files behind the blog posts
  • Run rake deploy to rsync the static files to a web server

That's it. The config is documented in the Octopress docs.

And if you're lazy like me, use the combined rake command:

  • Run rake gen_deploy to generate the blog and deploy it to your server. Hooray!

And that's it? That easy?

Yes... and no.

rake deploy wants a public key to connect to your web server.

NearlyFreeSpeech.net will let you use a public key to authenticate. However, you have to file a free assistance ticket and wait a couple of hours for the key to be set up on your account.

More information can be found here on NFS.net's FAQ, but it's a very simple process:

  • Click the link titled "assistance request" to submit a free assistance request.
  • Copy your id_rsa.pub and paste it in the text field, and ask them to add that pub key to your account.
  • Wait two hours.

And you're done! Your dev server will now be able to deploy straight to any of your NFS sites without a password.

I hope this information helps anyone looking for info on how to deploy to NearlyFreeSpeech.net via an external server.