Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have successfully installed couchdb via homebrew:

% brew install couchdb

...and invoked mutiple instances as directed here:

% OLD=/usr/local
% NEW=/tmp/couchdb

% mkdir -p $NEW/etc/couchdb/
% mkdir -p $NEW/var/{lib,log,run}/couchdb/

% cp $OLD/etc/couchdb/local.ini $NEW/etc/couchdb/

local.ini changes:

database_dir = /tmp/couchdb/var/lib/couchdb
view_index_dir = /tmp/couchdb/var/lib/couchdb
uri_file = /tmp/couchdb/var/run/couchdb/couch.uri

port = 5985
bind_address =

file = /tmp/couchdb/var/log/couchdb/couch.log

... and startup the startup command:

% couchdb -i -a /tmp/couchdb/etc/couchdb/local.ini

Now that I have this working, how can I start up each instance on boot, and if I wanted to kill an instance (preferred by name or some known identifier), how might selectively do that? I'm running OSX Mountain Lion 10.8.3 (with Xcode command line tools) in case that helps.

share|improve this question

The OS X way to start things at boot is launchd, specifically a LaunchDaemon. For a complete understanding, it's worthwhile to read the Apple documentation on launchd; also, there are many questions and answers here to help you.

The short version is, you'll need a file, eg /Library/LaunchDaemons/org.inator.couchdb that looks something like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Note that this will run as root; if you want it to run as a particular user, you'll need to use sudo (eg sudo -u inator /usr/local/couchdb …).

To start and the job manually, you can load and unload it from launchd using launchctl, eg:

launchctl load /Library/LaunchDaemons/org.inator.couchdb
launchctl unload /Library/LaunchDaemons/org.inator.couchdb

If you want another instance, just create a new file in /Library/LaunchDaemons with a different filename (and a matching Label).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.