Skip to end of metadata
Go to start of metadata



Chef can be installed on a variety of operating systems via Rubygems.

In general, you will need to

  1. Install Ruby 1.8.7+ and other dependencies
  2. Install Rubygems
  3. Install Chef


We recommend installing Ruby and dependencies other than Rubygems using a method common for your operating system.

Ubuntu or Debian Example

Below we give an example that works on Ubuntu or Debian. Alter this command to the equivalent command on your system. Check the Installation Notes section for tips relevant to your platform.

Install Ruby and other Dependencies

Chef is written in Ruby and thus requires Ruby as well as other system dependencies to run. Run the following command to install ruby and other required dependencies:

Chef 10.X Note

There are open issues with Chef 10.x and Ruby 1.8.6. If you are using Chef 10.x, you should get 1.8.7 with SSL bindings. If you'd like to use 1.9.1 or 1.9.2, you'll want to follow the Installing Chef Client on Other Operating Systems directions to install manually with gems.

Install RubyGems from Source

We prefer to install RubyGems from source rather than use the OS-provided version (if any), as it is cross platform, so we know what to expect.

Install RubyGems

Install Chef Gem

To install Chef and its dependencies, run the following code:

Install Chef




We have OS-specific instructions for the following operating systems

The bottom of this page also has tips for installing on various operating systems.

If you are installing Chef to use chef-client, proceed below. If you are installing Chef-solo as a means of installing Chef Server, return to Installing Chef Server using Chef Solo. If you wish to use Chef-solo as your primary Chef client, see Chef Solo.

Configure chef-client

The initial configuration of a chef-client requires a client.rb configuration file and a validation.pem file to be placed in /etc/chef. At a minimum client.rb must contain the configuration settings necessary for chef-client to communicate with chef-server. validation.pem is the permission certificate for your validator client. This API client is used on the first-run of chef-client and is used to create a new API client for the node. To create these we do the following:

  1. Create /etc/chef:

  2. Create client.rb and validation.pem:

    If you have a properly configured workstation, you should be able to run the following command from your workstation's chef repository

    This will place client.rb and validation.pem in your current working directory on your chef workstation. You can then use scp or another method to move both files into /etc/chef on the node you are configuring.

    If you do not have a configured workstation, you should create a minimal /etc/chef/client.rb. If you are using your own chef-server client.rbshould look as follows (substituting the correct address of your chef server):

    client.rb

    If you are using Hosted Chef, client.rbshould look as follows (with ORGNAME replaced with your Organization Short Name}}:

    client.rb for Hosted Chef

    If you are using an open source Chef 10 or earlier server, client.rb should look as follows:

    client.rb for Chef 10



    Your validation.pem can be downloaded from your chef-server if you are running your own chef-server. On your Chef Server, validation.pem should be in /etc/chef/. Users of Hosted Chef can find their validator client's key from the Hosted Chef Management Console. Note that if you are using Hosted Chef, your key is named ORGNAME-validator.pem.

Chef client has a number of configuration settings that do not appear above. See Chef Configuration Settings for further details.

Bootstrap

Once you know the install procedure for your platform you can create a Custom Knife Bootstrap Script template, allowing you to automate future installations of Chef using Knife.


Installation Notes for Various Operating Systems

FreeBSD 7.1

Pre-Installation Planning

You'll need Rubygems >= 1.3.0, which isn't in the version of ports that ships with 7.1-RELEASE, so upgrade ports first.

Upgrading Ports

Install Ruby and Rubygems

Make sure you have Ruby and Rubygems installed. On FreeBSD with ports installed:

Installing Ruby and Rubygems

OpenBSD

Tested Versions

These instructions have been verified to work with the following versions of OpenBSD, though they may work with older versions.

OpenBSD 5.1
OpenBSD 5.0
OpenBSD 4.9

Assumptions

This assumes that you have done a base install and have installed the compXY.tgz (i.e. comp51.tgz for OpenBSD 5.1) compiler file set during the installation. If you haven't, please see Adding a file set after install in the OpenBSD FAQ.

Pre-installation

You will want to add the following to the ~/.profile of the root user or a user capable of running pkg_add(1) as root:

Prepare PKG_PATH

You may wish to change the location of the PKG_PATH to a mirror closer to your location. Once set, either source the new .profile or logout and login again.

Install Prerequisites

The following will install ruby, rubygems, and ruby-iconv.

Installing Ruby, Rubygems and other prerequisites

You will want to make the installed binaries the default for your installation:

Post-install Administrivia

Gentoo

Installing Chef using Ebuilds

You will need to set some package.keywords, then simply emerge the Chef client.

You may start using chef-solo or edit /etc/chef/client.rb (at least edit chef_server_url) and start the client with it's init script.

OpenSolaris

Installing Ruby

From Download Ruby:

  • Ruby 1.8.7 are available for Solaris 8 through Solaris 10 on Sunfreeware and Ruby 1.8.7 is available at Blastwave. Using RVM can get you the latest version of Ruby 1.9.2.
  • To install Ruby on OpenIndiana, please use the Image Packaging System, or IPS client. This will install the latest Ruby binaries and Rubygems directly from the OpenSolaris network repository for Ruby 1.9. It’s easy:






Installing Chef Client and Chef Solo


Upgrade Instructions



Labels
  • None