I've installed CouchDB via MacPorts. Now I want to start it when my Mac boots, so I executed the instructions given in the install process:

sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist

However this doesn't seem to work. I've looked inside the LaunchDaemons directory, and the plist file is there (as a symlink):

lrwxr-xr-x  1 root  wheel   57 18 aug 10:11 org.apache.couchdb.plist -> /opt/local/Library/LaunchDaemons/org.apache.couchdb.plist

The contents of the actual plist file seem ok (however I have no real knowledge of how it should look):

<plist version="1.0">


When I execute /opt/local/bin/couchdb manually, the process is created, so no problems there. It just seems the launch daemon skips this command.

Any thoughts on how to fix this?

  • If you change the StandardOutPath and StandardErrorPath to rel files do they show anything?
    – mmmmmm
    Commented Aug 26, 2010 at 9:35
  • I'm not quite sure what you mean by 'show anything'. Anyway I've looked at other plist files and they have the same values, so I don't think that's the problem. Commented Aug 26, 2010 at 14:41
  • "However this doesn't work" What do you get instead? Does launchctl exit like everything went fine, or you have an error? Does launchctl list show the daemon?
    – zneak
    Commented Aug 26, 2010 at 18:48

2 Answers 2


Try the following (one-line command) :

sudo chown -R couchdb:couchdb /opt/local/var/lib/couchdb/ /opt/local/var/log/couchdb/ /opt/local/etc/couchdb/ /opt/local/var/run/couchdb

Then reboot.

If it doesn't work, what version of MacPorts and CouchDB do you have ?

  • 1
    why rebooting? a sudo launchctl unload -w /Library/LaunchDaemons/org.apache.couchdb.plist && sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist will do fine Commented Aug 28, 2010 at 10:30
  • Was too lazy :P
    – Studer
    Commented Aug 28, 2010 at 12:57

I'm not specifically familiar with CouchDB, but I see a couple of potential problems with your .plist file: first, the HOME value being set is weird -- it should be a specific folder path (i.e. wherever you put the couchdb user's home folder), not ~. Second, I suspect you also need to set the PATH environment variable so CouchDB can find the other optional programs you've installed. So that section of the .plist should look something like this:


(Note: the above values are guesses based on a little googling -- you may need to adjust them to where your CouchDB user's home is and/or where your add-on binaries folders are.) To load the changed .plist file, use:

sudo launchctl unload /Library/LaunchDaemons/org.apache.couchdb.plist
sudo launchctl load /Library/LaunchDaemons/org.apache.couchdb.plist

If that doesn't solve the problem, there are a couple of places to look for more info about what's going wrong: first, take a look at the system log (/var/log/system.log), either with the Console utility or a command line tool; it'll have any errors that launchd ran into while trying to process the .plist file or start CouchDB. Second, follow Mark's suggestion about changing StandardOutPath and StandardErrorPath to real files, and looking at what shows up there. This isn't needed if everything's configured properly, but can be very useful for finding out what's wrong when there's a problem (and you can switch them back to /dev/null after the problem has been solved).

  • +1 for your detailed approach, however I rather not resort to hacking the plist file (I assume the MacPorts distributed one is right, and will be overwritten again when I upgrade it). Turns out it was a simple rights issue. Commented Aug 29, 2010 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .