Installing CouchDB on CentOS 5

couchdb-logo

I have been meaning to have a play with CouchDB for a while now, so this afternoon I finally had a go at installing it on my (32 bit) CentOS 5 box. Here is what I learnt along the way…


The first surprises are that:

  1. There are no CouchDB packages available for RHEL/CentOS.
  2. The official instructions tell you to install CouchDB from the project’s trunk.

Nevertheless, I press on. The first thing thing you need to do, but the official docs fail to mention, is install the EPEL repository:

su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'

Next you need to install the various packages (I also needed ‘libtool’, which wasn’t mentioned in the docs):

yum install ncurses-devel openssl-devel icu libicu-devel js \
 js-devel curl-devel erlang erlang-devel libtool

After a sluggish download you are ready to proceed with checkout out CouchDB from Subversion:

svn checkout http://svn.apache.org/repos/asf/couchdb/trunk couchdb

Then configure, install etc:

cd couchdb
./bootstrap
./configure --with-erlang=/usr/lib/erlang/usr/include && \
make && \
 make install

Note that if you are on a 64bit machine (which most machines should be nowadays), then you may need to change the configure command above to be:

./configure --with-erlang=/usr/lib64/erlang/usr/include && \
make && \
make install

With any luck that should complete happily, and you can move on to configuring CouchDB:

vim /usr/local/etc/couchdb/local.ini

I left this as-is for now.

Next setup users, directories and permissions (I found some directories missing, so the mkdir command should sort that out):

mkdir -p /usr/local/var/lib/couchdb \
/usr/local/var/log/couchdb \
/usr/local/var/run/couchdb
adduser -r -d /usr/local/var/lib/couchdb couchdb
chown -R couchdb /usr/local/var/lib/couchdb
chown -R couchdb /usr/local/var/log/couchdb
chown -R couchdb /usr/local/var/run/couchdb

And then you should be good to go! To launch CouchDB in the console (handy for debugging), just do:

sudo -u couchdb couchdb

Or to start it as a Daemon, do:

sudo /usr/local/etc/rc.d/couchdb start

And now you can start doing fun stuff, but that will be another blog post…

Update: Jan as helpfully pointing out the official README documentation.


9 comments so far

  1. mixdev on

    Cool! But why do we need EPEL? I am not clear with that. Could you shed some light on it?

    • Adam Charnock on

      Hey,

      Sure. It seems that the EPEL repository is needed in order to install the Erlang-related packages (Erlang is the language in which CouchDB is written).

      Hopefully everything will get packaged up nicely when they get reach version 1!

  2. Jan on

    Hi,

    the official install docs are in the README*. The wiki contains user-supplied help for other users. If you find any errors in the wiki, feel free to fix or add as needed. Thanks!

    * http://svn.apache.org/viewvc/couchdb/trunk/README?view=markup

    Cheers
    Jan

    • Adam Charnock on

      Hi Jan,

      Thanks for letting me know! I have updated the post with a link to the README.

      Adam

  3. Michael on

    Hey there -

    this post really helped me a lot getting started with Couch DB.

    Thanks so much!

    Michael

  4. brian on

    Thanks, worked as expected. You might want to add sudo to the install itself:

    sudo make install

  5. lbjay on

    I was about to embark on following these great instructions when I figured out that the EPEL (http://fedoraproject.org/wiki/EPEL/FAQ) repository has packages for erlang and couchdb. I just needed to include “–enablerepo=epel” in the yum search command.

  6. Paul on

    It seems that another problem is that curl is only available at 7.15 for CentOS but CouchDB requires 7.18 . Is there a solution for this?

    • Adam Charnock on

      Ouch, that is unfortunate.

      I don’t have a good answer for you on that one. All I can say is that I recently got pretty tired of the outdated packages on CentOS and am moving a number of my servers to Ubuntu 9.10.


Leave a reply