How to Install Apache CouchDB 1.3 on CentOS 6.2

June 21, 2013

This is quick how to on installing Apache CouchDB 1.3 on CentOS 6.2, CouchDB is a popular NoSQL solution that uses JSON to store data, Javascript as its query language using MapReduce and HTTP for an API. This blog will cover the basics of installation, I will cover tuning or scaling scenarios in later blogs.

Environment:

Centos 6.2
CouchDB 1.3

Install EPEL and REMI Repos

mkdir COUCHDB_INSTALL
cd COUCHDB_INSTALL
mkdir RPM
cd RPM
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-6-8.noarch.rpm

Install CouchDB Prerequisites:

yum install libicu-devel openssl-devel curl-devel make gcc erlang js-devel libtool which gcc-c++

Install CouchDB:

cd ..
mkdir SOURCE
cd SOURCE
wget http://www.eng.lsu.edu/mirrors/apache/couchdb/source/1.3.0/apache-couchdb-1.3.0.tar.gz
gunzip -c apache-couchdb-1.3.0.tar.gz | tar -xvf -
cd apache-couchdb-1.3.0
./configure --with-erlang=/usr/lib64/erlang/usr/include
make
make install

Create CouchDB User and Give The Proper Permissions:

adduser -r --home /usr/local/var/lib/couchdb -M --shell /bin/bash --comment "CouchDB Administrator" couchdb
chown -R couchdb:couchdb /usr/local/etc/couchdb
chown -R couchdb /usr/local/var/lib/couchdb
chown -R couchdb /usr/local/var/run/couchdb
chown -R couchdb:couchdb /usr/local/var/log/couchdb
chmod -R 0770 /usr/local/etc/couchdb
chmod -R 0770 /usr/local/var/lib/couchdb
chmod -R 0770 /usr/local/var/log/couchdb
chmod -R 0770 /usr/local/var/run/couchdb

Add the CouchDB init Script:

ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
chkconfig --add couchdb
chkconfig --level 1234 couchdb on

Basic Edits for CouchDB Config:

Add the address for CouchDB to listen on.

vim /usr/local/etc/couchdb/local.ini
[httpd]
;port = 5984
;bind_address = 127.0.0.1
bind_address = x.x.x.x

Verify and Add an Admin Password

Make sure to add a Admin user for security reasons immediately.

http://x.x.x.x:5984/_utils/

Comments for “How to Install Apache CouchDB 1.3 on CentOS 6.2”

  1. Hi Phil,
    Thanks for the great article! As an alternative, I’ve found that the following allows for creating RPMs for specific CouchDB/Erlang versions of your choosing – might be a nice option?:

    http://dgunix.com/167-creating-self-contained-couchdb-rpms-for-centos6/

    Thanks,
    Darren.

  2. Rodney commented on November 14, 2014

    This is very useful guide if someone wants to install CouchDB from source. Here is another one if you like to install CouchDB using yum on Centos.
    https://www.rosehosting.com/blog/install-couchdb-on-a-centos-linux-vps/

    Thanks.

  3. Awesome post – all the others I came across did not work. This one worked no issues – ONE TIME!!! 🙂

Leave a Reply