Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the supermarket mailing list.

Select Badges

Select Supported Platforms


sitecore (3) Versions 0.5.1

Installs/Configures Sitecore

cookbook 'sitecore', '~> 0.5.1'
cookbook 'sitecore', '~> 0.5.1', :supermarket
knife cookbook site install sitecore
knife cookbook site download sitecore

Sitecore Cookbook

Cookbook to install the Sitecore 7.x content management system.


This cookbook implements resources useful for installing and/or configuring Sitecore:

The sitecore_cms resource installs the files, sets permissions, and makes IIS configurations for serving a website powered by Sitecore. There's also an optional action to enable the Solr content search provider.

The sitecore_config resource enables and disables settings in the App_Config\Includes directory.

The sitecore_db resource attaches the Sitecore databases, creates a user account, and grants it permissions on those DBs.

These resource can be used together to spin up a VM on a developer workstation, or independently to provision separate database & application server nodes in other environments.

There's also an IIS helper recipe which can be used to quickly install some common features. This recipe is optional and you're welcome to set up IIS however you like as long as it has all the requirements for Sitecore 7.

This cookbook expands on some of the ideas found in the Sitecore Powershell Library.

Neither the Sitecore CMS, Windows, nor a license file are included with this cookbook. Users are responsible for obtaining and licensing the proprietary bits of a Sitecore tech stack on their own. The licensing of this cookbook does not apply to Sitecore or Windows.

This cookbook references proprietary software. See NOTICE for more information.


  • Chef 11.10 or higher
  • Ruby 1.9 or higher
  • Windows
    • Tested with Windows Server 2012
  • IIS
    • Tested with IIS 8
  • SQL Server
    • Tested with SQL Server 2012 and SQL Server Express 2014
  • Powershell with SQL Server Management Objects


Attributes live in node['sitecore']. Read the source code in attributes/ to see what attributes are available, and their default values.

Resource/Provider Usage


Installs Sitecore to inetpub, creates an IIS website and app pool.

Paths to assets such as the sitecore zip, license file, etc... can be local, i.e. you've placed them in a temporary location using chef resources such as cookbook_file, or remote, such as a secured and restricted URL accessible by Chef.

Example Usage

sitecore_cms 'MySite' do
  source 'c:/path/to/'
  license 'c:/path/to/license.xml'
  bindings [
    { 'host' => '', 'proto' => 'http', 'port' => 80 }
  connection_strings [
      'name' => 'core',
      'database' => 'Sitecore.Core',
      'user_id' => 'sitecore_user',
      'password' => 'foobar123',
      'data_source' => '(local)\SQLEXPRESS'
      'name' => 'master',
      'database' => 'Sitecore.Master',
      'user_id' => 'sitecore_user',
      'password' => 'foobar123',
      'data_source' => '(local)\SQLEXPRESS'
      'name' => 'web',
      'database' => 'Sitecore.Web',
      'user_id' => 'sitecore_user',
      'password' => 'foobar123',
      'data_source' => '(local)\SQLEXPRESS'
      'name' => 'analytics',
      'connection_string' => 'mongodb://mongodb/analytics'

Example of using the Solr content search provider

sitecore_cms 'MySite' do
  action [:install, :enable_solr]
  source 'c:/path/to/'
  solr_libs 'c:/path/to/'
  bindings [
    # My site's bindings
  connection_strings [
    # My site's connection strings
  license 'c:/path/to/license.xml'

In this example we add the :enable_solr action and supply the path to a zip file of Sitecore's Solr dlls, which will be placed in the website's bin directory, i.e. c:/inetpub/wwwroot/mysite/website/bin.


Enables or disables configuration files. If the name of a site is given, the provider will look in the default location of c:\inetpub\wwwroot\SiteName\App_Config\Include. The full path to your includes directory can be specified via the configs_path attribute.

If both site and configs_path are given, configs_path takes precedence.

Example Usage

sitecore_config 'Sitecore.Mvc' do
  site 'MySite'
  action :enable

sitecore_config 'Sitecore.MvcAnalytics' do
  configs_path 'D:\MySite\App_Config\Includes'
  action :disable


Sets up one or more Sitecore databases.

Assumes that SQL Server is present, and the account running Chef has permission to create databases, users, and assign roles. If you're using vagrant, this means the vagrant user on your development box.

Example Usage

sitecore_db '.\SQLEXPRESS' do
  action [:install, :create_login, :assign_roles]
  site 'MySite'
  databases [
    { 'name' => 'Sitecore.Core', 'type' => 'core' },
    { 'name' => 'Sitecore.Master', 'type' => 'master' },
    { 'name' => 'Sitecore.Web', 'type' => 'web' },
    { 'name' => 'Sitecore.Analytics', 'type' => 'analytics' }
  source_directory 'c:/inetpub/wwwroot/MySite/Databases'
  username 'sitecore_user'
  password 'foobar123'

This resource will look for mdf and ldf files corresponding to each database name in the source_directory and attach them to the SQL server at .\SQLEXPRESS (or whichever host you provide).

A login named "sitecore_user" will be created with the given password, and granted the roles defined in node['sitecore']['roles'].

Refer to "Evolution of Cookbook Development" by Opscode for information on handling sensitive data with Chef.


default recipe takes no action.

iis recipe is included as a tool for setting up the roles needed to serve a Sitecore site. Using it is optional, and you're welcome to implement your own logic for configuring IIS.


Use Rspec to execute the ChefSpec tests:

$ rspec


See for help with problems commonly encountered by users of this cookbook. If that document doesn't address your situation, feel free to open an issue on Github.

How to contribute

Please read to learn how you can help improve this cookbook.



Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependent cookbooks

git ~> 4.0
openssl ~> 1.1
iis ~> 4.1
powershell ~> 3.0
windows ~> 1.36

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Sitecore Cookbook Change Log

This file is used to list changes made in each version of the Sitecore cookbook.

v 0.5.1 (2015-05-08)

  • #19 Add ability to pass an entire connection string.

v 0.5.0 (2015-04-14)

  • #1 Stop flooding the console with ChefSpec deprecation notices
  • #3 Remove incorrect use of symbols from documentation
  • #4 Support the directory structure of Sitecore 7.5 zip files
  • #6 Document the open source contributor process
  • #9 Create a changelog
  • #11 Fix mixlib-shellout problems with bundle install

v 0.4.0 (2015-03-12)

  • Initial public release
  • Sitecore 7.0 support
  • Install the CMS files
  • Enable Solr
  • Configure IIS website and application pool
  • Attach databases
  • Create database user and assign roles
  • Enable/disable App_Config\Include configuration files

Foodcritic Metric

0.5.1 passed this metric