Install Apache CouchDB 1.6.1 on RHEL/CentOS/Fedora and Debian/Ubuntu

This is our new series on Apache CouchDB and this article explains how to install CouchDB 1.6.1 on RHEL/CentOS 7/6, Fedora 22-15, Debian 8/7 and Ubuntu 15/14 systems using source tarball installation. What is...

Spread the love

This is our new series on Apache CouchDB and this article explains how to install CouchDB 1.6.1 on RHEL/CentOS 7/6, Fedora 22-15, Debian 8/7 and Ubuntu 15/14 systems using source tarball installation.

Install Apache CouchDB in CentOS

Install Apache CouchDB in CentOS and Debian

What is Apache CouchDB?

Apache CouchDB is an open source document-oriented database with NoSQL. NoSQL means, it doesn’t have any database schema, tables, rows, etc, that you will see in MySQL, PostgreSQL and Oracle. CouceDB uses JSON to store data with documents, which you can access from a web browser via HTTP. CouchDB works smoothly with all latest modern web and mobile apps.

CouchDB Requirements

To install CouchDB, we need to have required collections of packages installed on our systems that CouchDB depends on.

  1. Erlang OTP (>=R14B01, =<R17)
  2. ICU
  3. OpenSSL
  4. Mozilla SpiderMonkey (1.8.5)
  5. GNU Make
  6. GNU Compiler Collection
  7. libcurl
  8. help2man
  9. Python (>=2.7) for docs
  10. Python Sphinx (>=1.1.3)

Step 1: Install Build Tools and Required Dependencies

1. As I mentioned above in requirement section, that we need to have dependencies installed on our server before compiling CouchDB.


First do a full system update and then install needed dependencies using yum or apt package manager.

On RHEL/CentOS and Fedora
# yum update
# yum install autoconf autoconf autoconf-archive automake ncurses-devel curl-devel erlang-asn1 erlang-erts erlang-eunit erlang-os_mon erlang-xmerl help2man js-devel libicu-devel libtool perl-Test-Harness
Install CouchDB Prerequisites in CentOS

Install CouchDB Prerequisites in CentOS

On Debian/Ubuntu
# apt-get update
# apt-get install build-essential erlang-base-hipe erlang-dev erlang-manpages erlang-eunit erlang-nox libicu-dev libmozjs185-dev libcurl4-openssl-dev
Install Dependency Packages on Debian

Install Dependency Packages on Debian

Step 2: Insall Erlang and Mozilla SpiderMonkey

2. Important: This step is for RedHat and CentOS based systems, due to unavailability of Erlang and Mozilla SpiderMonkey packages from default repository, we need to compile these two packages from source.

Compiling Erlang Package
# wget http://www.erlang.org/download/otp_src_R14B01.tar.gz
# tar -xvf otp_src_R14B01.tar.gz
# cd otp_src_R14B01
# ./configure
# make && make install
Download Erlang

Download Erlang

Configure Erlang

Configure Erlang

Compiling Mozilla SpiderMonkey
# wget http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz
# tar -xvf mozjs17.0.0.tar.gz
# cd mozjs17.0.0/js/src/
# ./configure
# make && make install
Download Mozilla SpiderMonkey

Download Mozilla SpiderMonkey

Compile Mozilla SpiderMonkey

Compile Mozilla SpiderMonkey

Step 3: Installing CouchDB

3. Once all the dependencies are satisfied, you can download and install CouchDB from source using following commands.

# wget http://mirror.tcpdiag.net/apache/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
# tar -xvf apache-couchdb-1.6.1.tar.gz
# cd apache-couchdb-1.6.1
# ./configure
# make && make install
Download Apache Couchdb

Download Apache Couchdb

Configure Apache CouchDB

Configure Apache CouchDB

Build Apache CouchDB

Build Apache CouchDB

Step 3: Configuring CouchDB

4. Once CouchDB compiled successfully, it’s time to create a new CouchDB user, grant correct permissions and add the startup scripts.

On RHEL/CentOS and Fedora
# adduser --no-create-home couchdb
# chown -R couchdb:couchdb /usr/local/var/lib/couchdb /usr/local/var/log/couchdb /usr/local/var/run/couchdb
# ln -sf /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
# chkconfig --add couchdb
# chkconfig couchdb on
Create and Setup CouchDB on CentOS

Create and Setup CouchDB on CentOS

On Debian and Ubuntu
# adduser --no-create-home couchdb
# chown -R couchdb:couchdb /usr/local/var/lib/couchdb/ /usr/local/var/log/couchdb/ /usr/local/var/run/couchdb/
# ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
# update-rc.d couchdb defaults
Setup CouchDB on Debian

Setup CouchDB on Debian

5. By default, CouchDB can be accessed within the server itself, if you would like to access it from the web, you need to modify the file /usr/local/etc/couchdb/local.ini and change the settings under [httpd] section as shown below.

# vi /usr/local/etc/couchdb/local.ini
[httpd]
port = 5984
bind_address = 0.0.0.0

6. Now it’s time to start CouchDB service.

# /etc/init.d/couchdb start
# /etc/init.d/couchdb status
Start Apache CouchDB

Start Apache CouchDB

Step 5: Verifing CouchDB

7. Verify the CouchDB by going to the below URL, there will see a Welcome page that displays the following message.

http://your-ip-address:5984
Verify Apache CouchDB Access

Verify Apache CouchDB Access

8. Next, visit Couchdb web interface to create and manage the Couchdb database.

http://your-ip-address:5984/_utils/
Apache CouchDB Dashboard

Apache CouchDB Dashboard

9. By default there is no admin user, you need to create one by just clicking on the bottom right corner that says “Fix this“. Once you click on that link you will prompted to enter admin user and password. Refer screen below.

Create CouchDB Admin User

Create CouchDB Admin User

For more information on how to create a database and manage their settings visit THIS PAGE, or stay tuned for our next series of articles on CouchDB.

Facebook Comments
Spread the love

Posted by News Monkey