How to Install Apache CouchDB on CentOS 8

Install Apache CouchDB on CentOS 8

In this article, we will have explained the necessary steps to install Apache CouchDB on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Apache CouchDB is a free software resource that allows us to access data from where necessary by defining the Couch Replication Protocol, which was implemented by a variety of projects and products that cover all IT environments, from globally distributed server clusters, or mobile phones to web browsers.

Install Apache CouchDB on CentOS 8

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo dnf install epel-release
sudo dnf update

Step 2. Install Apache CouchDB on the CentOS system.

Now we add the CouchDB repository:

sudo nano /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo

Enter the following:

[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

Once done, we can install couchDB with the following command:

sudo dnf install couchdb

After the installation is completed, enable and start the CouchDB service:

sudo systemctl enable --now couchdb

Step 3. Configuration of CouchDB on CentOS 8.

CouchDB can be configured either as a standalone mode or in a clustered mode. In this guide, however, we are going to configure the CouchDB server in the single-mode configuration. Also, we will configure CouchDB such that we can access it via a web browser:

sudo nano /opt/couchdb/etc/local.ini
[admins]
admin = my-secure-passwd

Restart the CouchDB service to change the password to a hash:

sudo systemctl restart couchdb

Step 4. Configuration Firewall.

Remember that CouchDB works through port 5984. So, the first thing is to open that port in the firewall:

sudo firewall-cmd --add-port=5984/tcp --permanent --zone=public
sudo firewall-cmd --reload

Step 5. Verifying CouchDB Installation

 To check if the installation was done successfully, issue the following curl command that will display the CouchDB database information in JSON format:

curl http://127.0.0.1:5984/

If you prefer GUI, you can access the CouchDB web-based interface, Fauxton at:

http://127.0.0.1:5984/_utils/

That’s all you need to do to install CouchDB on CentOS 8. I hope you find this quick tip helpful. For further reading on Apache CouchDB, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.