How to Install Apache CouchDB 2.3.0 in Linux

Apache CouchDB is an open source document-oriented database with NoSQL – means, it doesn’t have any database schema, tables, rows, etc, that you will see in MySQL, PostgreSQL, and Oracle. CouchDB 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.

This article explains how to install Apache CouchDB 2.3.0 on RHEL, CentOS, Fedora, Debian and Ubuntu Linux distributions using the convenience binary packages.

Enabling the Apache CouchDB Package Repository

To install Apache CouchDB on CentOS and RHEL distributions, first you need to install and enable EPEL repository and update the system software packages to latest using following commands.

# yum update
# yum install epel-release

Next, on CentOS distribution, create a file called /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo and place the following text into it.

[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

On RHEL distribution, create a file called /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo and place the following text into it. Make sure to replace the version number el7 or el6 in the file.

[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

On Debian/Ubuntu distributions, run the following command to enable repository. Make sure to replace {distribution} with the appropriate choice for your OS version: Debian 8: jessie, Debian 9: stretch, Ubuntu 14.04: trusty, Ubuntu 16.04: xenial or Ubuntu 18.04: bionic.

$ echo "deb https://apache.bintray.com/couchdb-deb {distribution} main" | sudo tee -a /etc/apt/sources.list

Installing the Apache CouchDB Packages

On CentOS and RHEL distributions, issue the following command to install Apache CouchDB packages.

# yum -y install epel-release && yum install couchdb

On Debian/Ubuntu distributions, first you need to install the repository key, update the repository cache and install the Apache CouchDB packages.

$ curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
$ sudo apt-get update && sudo apt-get install couchdb

Configure the Apache CouchDB

By default, CouchDB runs on port 5984 and can be accessed within the server itself [localhost] only, if you would like to access it from the web, you need to modify the file /opt/couchdb/etc/local.ini and change the settings under [chttpd] section as shown below.

# vi /opt/couchdb/etc/local.ini
[chttpd]
port = 5984
bind_address = 0.0.0.0

Next, go to the bottom of this file and define the admin user and password as shown.

[admins]
admin = tecmint

Restart and enable the CouchDB service after making above changes.

# systemctl enable couchdb.service
# systemctl restart couchdb.service
# systemctl status couchdb.service

Verifying Apache CouchDB

Verify the CouchDB by going to the below URL http://your-ip-address:5984, there will see a Welcome page that displays the following message.

{"couchdb":"Welcome","version":"2.3.0","git_sha":"07ea0c7","uuid":"1b373eab0b3b6cf57420def0acb17da8","features":["pluggable-storage-engines","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

Next, visit Couchdb web interface at http://your-ip-address:5984/_utils/ to create and manage the Couchdb database.

Create Database in Couchdb
Create Database in Couchdb

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.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

10 Comments

Leave a Reply
  1. Pingback: Install MongoDB 2.0.6 on on RHEL/CentOS 5-6 & Fedora 12-17
  2. Your title, “Install Apache CouchDB 1.6.1 on RHEL/CentOS/Fedora and Debian/Ubuntu”, is misleading in two very important ways. First you state that this is an “Install”. It is not. It is a *recompile of source code* and *install from source* (i.e. “make install”). If this were just an “install” on RHEL-derived distributions, it would be in RPM packages. And similarly, DEB packages for Debian-derived systems.
    Secondly, you state “…RHEL/CentOS…”. Then in the instructions, you say “…how to install CouchDB 1.6.1 on RHEL/CentOS 7/6…”. For someone looking to install CouchDB on a multitude of RHEL 5 systems, the title is misleading.

    Reply
  3. Hi Ravi,
    Nicely laid out article, thanks for sharing.

    Just as a heads up though; having run the CouchDB instance from EPEL (and a few other sources) i was quite frustrated with running a seriously old version – Erlang included!

    I published an article on how to package a standalone RPM for CentOS 6 which you might find useful? This will package the CouchDB version of your choice, along with an Erlang version of your choosing: http://dgunix.com/167-creating-self-contained-couchdb-rpms-for-centos6/

    Thanks again!
    Darren.

    Reply
  4. Pingback: tech: installing Couchdb on RHEL the easy way | marcelk.org

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.