How to install Apache CouchDB on CentOS/RHEL 7/6

CouchDB is an open-source database, and was first released in 2005 and later became an Apache Software Foundation project in 2008. Apache CouchDB is document-oriented database with NoSQL, it’s mean that there is no schema, tables, rows etc like other databases. Store your data safely, on your own servers. Your web and native applications love CouchDB, because it speaks JSON natively and supports binary data for all your data storage needs.

Apache CouchDB

Advantages:

Single Node Database:
CouchDB is a single-node database that works just like any other database behind an application.

Cluster:
CouchDB is also a clustered database that allows you to run a single logical database server on any number of servers.

HTTP/JSON:
CouchDB makes use of the HTTP protocol and JSON data format and is compatible with any software that supports them. CouchDB also works HTTP proxy servers, load balancers.

Offline First Data Sync:
CouchDB’s unique Replication Protocol is the foundation for a whole new generation of “Offline First” applications for Mobile applications and other environments with challenging network infrastructures.

Ecosystem:
CouchDB is built for servers, while PouchDB is built for mobile & desktop web-browsers and Couchbase Lite is built for native iOS & Android apps.

Reliability:
Individual nodes use a crash-resistant append-only data structure. A multi-node CouchDB cluster saves all data redundantly, so it is always available when you need it.

Step 1: Add CouchDB Repository

Apache CouchDB is not provided by the RHEL repository, but we can add the official repository of CouchDB.

# vim /etc/yum.repos.d/couchdb.repo 
[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el$releasever/$basearch/
gpgcheck=0
repo_gpgcheck=0
enabled=1

For RHEL:

[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el7/$basearch/
gpgcheck=0
repo_gpgcheck=0
enabled=1

Step 2: Add EPEL Repository

After adding CouchDB repository we need to add EPEL repository also. Use-mention command to add an epel repository.

CentOS/RHEL 7:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
CentOS/RHEL 6:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Step 3: Install CouchDB

We proceed to install Apache CouchDB by running the following line:

# yum -y install couchdb

After the installation process is finished. start CouchDB and make it run at startup:

For CentOS/RHEL 7:
# systemctl start couchdb
# systemctl enable couchdb
For CentOS/RHEL 6:
# service couchdb start
# chkconfig couchdb on

Step 4: Install Apache Web Server

If you don’t have Apache installed you can install it easily with the following command:

# yum install httpd

After that you can start Apache and make it run at the startup:

For CentOS/RHEL 7:
# systemctl start httpd
# systemctl enable httpd
For CentOS/RHEL 6:
# service httpd start
# chkconfig httpd on

Step 5: Enable Fauxton Web GUI Administration Panel

Fauxton is a web-based interface built into CouchDB. By default CouchDB used port no 5984. To enable the Apache CouchDB HTTP server, you must need to do some change in CouchDB configuration file.

# vim /opt/couchdb/etc/default.ini

Find the bind_address parameter in configuration file.

bind_address = 127.0.0.1

Change the bind_address.

bind_address = 0.0.0.0

Restart the CouchDB service to reflect the changes.

For CentOS/RHEL 7:
# systemctl restart couchdb
For CentOS/RHEL 6:
# service couchdb restart

Step 6: Access Fauxton Web GUI Administration Panel

Now, to access Apache CouchDB, access mention URL into the browser.

http://hostname:5984/_utils/ 
OR
http://IP_ADDRESS:5984/_utils/
CouchDB Admin Panel

Step 7: Create an Admins Account

Before a server admin is configured, all users have admin privileges. So you just need to create an admin account to prevent accidental (or malicious) data loss.

CouchDB Admin Account

Step 8: Verify CouchDB Installation

You can also verify the installation using admin panel.

CouchDB Verification

Reference: CouchDB Official Website

Enjoy it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.