Chef is a configuration management and automation platform from Opscode. Chef helps you describe your infrastructure with code. Because your infrastructure is managed with code, it can be automated, tested and reproduced with ease.

Taking your first steps with Chef can be daunting. There are new concepts to learn and best practices to understand. After completing each chapter of this book you will end up with a working example of a Chef setup that you understand. Concepts and best practices are explained by example so you'll know how to customise the code in the book for your own needs.

The book starts with the simplest way to use Chef and slowly introduces each new concept with examples. You'll understand how to overcome common problems before you encounter them and by the final chapter you will be equipped with all the tools required to manage even the most complicated cloud infrastructure.

This book tries to avoid magic and explains what each Chef example does so you'll understand exactly what is causing Chef to do whatever it is that it's doing.

Chef is evolving fast. We work hard to keep this book current but you might find some issues with the examples in this book. If you get stuck following an example or have any suggestions of things we should change please email

If you need some help with Chef or related tools why not talk to my company Hello Future?


This book is aimed at both experienced system administrators who want to automate their entire infrastructure and developers who do a bit of system administration through necessity. It is assumed that readers are comfortable using a terminal and already understand the basic building blocks of web servers.


1. First steps with Chef

The first chapter introduces you to the most simple way of working with Chef - over a SSH connection. If you occasionally setup cloud instances, virtual machines or dedicated servers over SSH and are looking for ways to automate that arduous process, you'll love this chapter.

2. Introducing Chef Server

The second chapter extends on the building blocks of the previous chapter and introduces working with Chef in client and server mode on your workstation or laptop rather than SSH.

3. More than one website

The third chapter extends our cookbook to work with multiple web sites and introduces slightly more advanced Chef concepts like data bags and search.

4. Managing multiple nodes

The fourth chapter takes our example WordPress hosting set up to the enterprise level by using Chef to configure multiple nodes.