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 Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


couchdb (24) Versions 3.0.0

Installs CouchDB 2.0 from package or source

cookbook 'couchdb', '= 3.0.0', :supermarket
cookbook 'couchdb', '= 3.0.0'
knife supermarket install couchdb
knife supermarket download couchdb
Quality 80%


Build Status

The CouchDB Cookbook is a library cookbook that provides custom resources for
use in recipes, designed to install and configure Apache CouchDB 2.x from
source, optionally enabling full-text search capabilities.

It includes reference examples illustrating how to install and configure a
standalone CouchDB server, or a full cluster of joined CouchDB server nodes.

Platform Support

The following platforms have been tested with Test Kitchen:

  • CentOS 7.3
  • Debian 7.11 (wheezy), 8.7 (jessie)
  • Ubuntu 14.04 (trusty), 16.04 (xenial)

Pull requests to add support for other platforms are welcome.

NOTE: This recipe cannot automatically install JDK 6 for Debian 8 and
Ubuntu 16. Please ensure this prerequisite is managed by roles preceeding
this one for your nodes if you wish to enable fulltext search ability.


The test cookbooks under test/cookbooks/couchdb-wrapper-test/recipes/ include
worked examples of how to include the CouchDB resources in your own cookbooks.
Here are a few excerpts.

Standalone (single-node) CouchDB

For a single CouchDB server, use the couchdb_node resource once:

couchdb_node 'couchdb' do
  admin_username 'admin'
  admin_password 'password'
  type 'standalone'

The fulltext true attribute can be added to enable full-text search

Clustered CouchDB nodes

All nodes in the cluster must have the same uuid, cookie, admin_username
and admin_password. It is recommended to pre-generate the UUID and place it in
your cookbook. The following one-liner will generate a CouchDB UUID:

python -c "import uuid;print(uuid.uuid4().hex)"

For each machine to run a CouchDB clustered node, use a block of the form:

uuid = <uuid_goes_here>

couchdb_node 'couchdb' do
  type 'clustered'
  uuid uuid
  cookie 'henriettapussycat'
  admin_username 'admin'
  admin_password 'password'

A single node in the cluster must also include the couchdb_setup_cluster
resource. DO NOT run this resource on all nodes in the cluster.

The couchdb_setup_cluster resource uses Chef Search to determine which nodes
to include in the cluster. By default, it searches for nodes with the role
specified in the role attribute. If desired, the search string can be
completely overridden with the search_string attribute.

Additionally, the number of nodes expected to be retrieved from Chef Search must
be specified in the num_nodes attribute. This prevents prematurely finalising
cluster setup before all nodes have been converged by Chef.

This example joins exactly 3 nodes with the role my_couchdb_role into a

couchdb_setup_cluster 'doit' do
  admin_username 'admin'
  admin_password 'password'
  role 'my_couchdb_role'
  num_nodes 3

Development "3-in-1" server

For development purposes, it is often useful to run a 3-node cluster on a single
machine to ensure that applications correctly respond to cluster-like CouchDB
behaviour. The recipe
test/cookbooks/couchdb-wrapper-test/recipes/three-nodes-from-source.rb is a
full example of how this can be done, and is used by Test Kitchen in the
verification of this cookbook.


  • Chef 12 or higher
  • Network-accessible package repositories
  • EPEL repositories on RHEL platforms


  • ubuntu (>= 14.04)
  • debian (>= 7.0)
  • amazon (>= 7.0)
  • centos (>= 7.0)
  • oracle (>= 7.0)
  • redhat (>= 7.0)
  • scientific (>= 7.0)
  • zlinux (>= 7.0)


  • build-essential
  • compat_resource
  • erlang
  • poise-python
  • yum-epel
  • java
  • maven


  • node['couch_db']['src_version'] - Apache CouchDB version to download. Defaults to 2.0.0.
  • node['couch_db']['src_mirror'] - Apache CouchDB download link. Defaults to{node['couch_db']['src_version']}/apache-couchdb-#{node['couch_db']['src_version']}.tar.gz.
  • node['couch_db']['src_checksum'] - sha256 checksum of Apache CouchDB tarball. Defaults to ccaf3ce9cb06c50a73e091696e557e2a57c5ba02c5b299e1ac2f5b959ee96eca.
  • node['couch_db']['install_erlang'] - Whether CouchDB installation will install Erlang or not. Defaults to true.
  • node['couch_db']['configure_flags'] - CouchDB configure options. Defaults to -c.
  • node['couch_db']['dreyfus']['repo_url'] - Full-text search: dreyfus repository URL. Defaults to
  • node['couch_db']['dreyfus']['repo_tag'] - Full-text search: dreyfus repository tag or hash. Defaults to d83888154be546b2826b3346a987089a64728ee5.
  • node['couch_db']['clouseau']['repo_url'] - Full-text search: clouseau repository URL. Defaults to
  • node['couch_db']['clouseau']['repo_tag'] - Full-text search: clouseau repository tag or hash. Defaults to 32b2294d40c5e738b52b3d57d2fb006456bc18cd.
  • node['maven']['version'] - Full-text search: Maven version for CouchDB full-text search. 3.2.5 or earlier REQUIRED. Defaults to 3.2.5.
  • node['maven']['url'] - Full-text search: URL to Apache Maven download. Defaults to
  • node['maven']['checksum'] - Full-text search: Apache Maven tarball sha256 checksum. Defaults to 8c190264bdf591ff9f1268dc0ad940a2726f9e958e367716a09b8aaa7e74a755.
  • node['maven']['m2_home'] - Full-text search: Location of m2 home. Defaults to /opt/maven.
  • node['couch_db']['enable_search'] - INTERNAL: Set to true by resource provider if search is enabled. Defaults to false.



INTERNAL USE ONLY. Downloads and compiles CouchDB from source.


INTERNAL USE ONLY. Creates directories, users, and installs runtime and build
prerequisites for CouchDB when installing from source.


  • couchdb_clouseau - This creates and destroys a CouchDB Clouseau (search) node, and is automatically invoked by the couchdb_node resource.
  • couchdb_node - This creates a CouchDB node, either standalone or as part of a cluster.
  • couchdb_setup_cluster - Optional role to join all nodes in the cluster together.


This creates and destroys a CouchDB Clouseau (search) node, and is automatically
invoked by the couchdb_node resource. There is no need to include this resource
directly in your wrapper cookbook.


  • create: Create the CouchDB Clouseau node. Default action.

Attribute Parameters

  • bind_address: The address on which the clouseau service will bind. Defaults to <code>""</code>.
  • index_dir: The directory in which the clouseau service will store its indexes. Defaults to <code>"default"</code>.
  • cookie: The Erlang cookie with which the clouseau service will join the cluster. Defaults to <code>"monster"</code>.


This creates a CouchDB node, either standalone or as part of a cluster.


  • create: Create the CouchDB node. Default action.

Attribute Parameters

  • bind_address: The address to which CouchDB will bind. Defaults to <code>""</code>.
  • port: The port to which CouchDB will bind the main interface. Defaults to <code>5984</code>.
  • local_port: The port to which CouchDB will bind the node-local (backdoor) interface. Defaults to <code>5986</code>.
  • admin_username: The administrator username for CouchDB. In a cluster, all nodes should have the same administrator.
  • admin_password: The administrator password for CouchDB. In a cluster, all nodes should have the same administrator.
  • uuid: The UUID for the node. In a cluster, all node UUIDs must match. Auto-generated if not specified.
  • cookie: The cookie for the node. In a cluster, all node cookies must match. Defaults to <code>"monster"</code>.
  • type: The type of the node - standalone or clustered. Defaults to <code>"clustered"</code>.
  • loglevel: The logging level of the node. Defaults to <code>"info"</code>.
  • config: A hash specifying additional settings for the CouchDB configuration ini files. The first level of the hash represents section headings. The second level contains key-pair values to place in the ini file. See test/cookbooks/couchdb-wrapper-test/recipes/one-node-from-source.rb for more detail. Defaults to <code>{}</code>.
  • fulltext: Whether to enable full-text search functionality or ont. Defaults to <code>false</code>.
  • extra_vm_args: Additional Erlang launch arguments to place in the vm.args file. Can be used to specify inet_dist_listen_min, inet_dist_listen_max and inet_dist_use_interface options, for example.


# Standalone node with full-text search enabled.
couchdb_node 'couchdb' do
  admin_username 'admin'
  admin_password 'password'
  fulltext true
  type 'standalone'


Optional role to join all nodes in the cluster together.

NOTE: Intended to be run on a SINGLE NODE IN THE CLUSTER. Adding this to
the run list of more than one node in the cluster will result in undefined,
probably WRONG behaviour.

Through the use of the address and port options, this resource can be
run on any Chef-managed machine. It does not have to run on a CouchDB node.

Operators can also avoid this role and manage cluster membership and
finalisation outside of Chef.


  • create: Default action.

Attribute Parameters

  • address: The CouchDB address through which cluster management is performed. Defaults to <code>""</code>.
  • port: The port for the CouchDB address through which cluster management is performed. Defaults to <code>5984</code>.
  • admin_username: The administrator username for CouchDB. In a cluster, all nodes should have the same administrator.
  • admin_password: The administrator password for CouchDB. In a cluster, all nodes should have the same administrator.
  • role: The role to which all nodes in the cluster should belong. Used with Chef Search to retrieve a current list of node addresses and ports. Defaults to <code>"couchdb"</code>.
  • search_string: Override of the default roles:<role> Chef Search expression. Modify this if you need to build a list of nodes in the cluster via different search terms. Defaults to <code>"default"</code>.
  • num_nodes: Required. Number of nodes the Chef Search should return. Ensures that all nodes have been provisioned prior to joining them into a cluster.
  • node_list: Optional array of [address, port] pairs representing all nodes in the cluster. If a static list is specified here, it will override the Chef Search. Only these nodes will be joined into the cluster. Only use this as a last resort. Example: [['', 15984], ['', 25984], ['', 35984]]. Defaults to <code>[]</code>.

License and Maintainer

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.

Copyright 2014-2017, Joan Touzet; Copyright 2009-2014, Opscode, Inc.

CouchDB Cookbook CHANGELOG

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


  • Complete rewrite of cookbook as 2 custom resources
  • Currently only installs CouchDB from source as packages are not available
  • Supports CouchDB 2.0+
    • If CouchDB 1.x is required, use v2.5.3 of this cookbook.
  • Supports full-text search add-on


  • Final release explicitly targeting CouchDB 1.x.
  • Multiple fixes for CentOS, recent Debian/Ubuntu builds
  • Prefer /usr/lib64/ over /usr/lib when present
  • Store CouchDB UUID into host-specific local.ini file
  • New database LWRP provider
  • Source downloaded via https (closes #40)
  • Clean up build directory when building from source
  • Fixed init script problem on multiple platforms
  • Documentation received a complete overhaul
  • Many style cleanups for Ruby and Chef 12/13
  • Full support for test-kitchen, rubocop, rake, foodcritic, etc.
    • Includes basic smoke test


  • Add nohup to running couch to make it work with Test Kitchen
  • adding case for libmozjs package for ubuntu 14.04
  • Specify upstart service provider for ubuntu >=13.10


  • New cookbook maintainer
  • Update default version to CouchDB 1.5.0
  • Update source download URL to new format
  • Fix testkitchen support
  • Fix stray "w" in 1.5.0


  • Porting to use cookbook yum ~> 3.0
  • Fixing up style to pass rubocop
  • Updating testing bits


  • fixing metadata version error. locking to 3.0


  • Locking yum dependency to '< 3'



  • COOK-3659 - Don't change directory ownership of /var/run



  • COOK-3323 - Force local.ini file changes to restart CouchDB


  • [COOK-1629] - source recipe not working on centos 5.8
  • [COOK-2608] - Update source install version to 1.2.1


  • [COOK-1905] - It should be possible to customize the local.ini file in couchdb cookbook


  • [COOK-2139] - fedora has couchdb package, no EPEL required


Major version bump due to use of platform_family (only available on newer versions of ohai/chef).

  • [COOK-1838] - Switch to platform_family approach to support scientific


  • [COOK-1623] - add attribute to prevent erlang installation
  • [COOK-1627] - set attributes at default precedence instead of normal (set)


  • [COOK-1399] - make bind address an attribute


  • Create group for couchdb

Collaborator Number Metric

3.0.0 passed this metric

Contributing File Metric

3.0.0 passed this metric

License Metric

3.0.0 passed this metric

Testing File Metric

3.0.0 passed this metric

Version Tag Metric

3.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number