Friday, September 17, 2021
HomeLinuxHow to Install and Configure CouchDB on Linux Distros

How to Install and Configure CouchDB on Linux Distros [Guide]

CouchDB is a document-oriented open source and free Database. It works with the NoSQL method like the MongoDB. As the CouchDB uses the JSON file format, so it has a storage capacity. You can use API to interconnect the one single CouchDB with many applications and plugins. CouchDB is a cross-platform database; you can use it on Windows, Mac, and Linux distributions. It uses the couch replication method to create databases. The attractive user friendly web-based GUI and dashboard of CouchDB will positively attract every Linux user.

Features of CouchDB


You can use the cluster method on CouchDB to connect it with multiple databases. Even you can make nodes and junctions to manage larger numbers of databases. You can manage metadata, user data, raw data, and other types of data through CouchDB. Those who work with BigData might be familiar with the contradictory concept of using SQL or NoSQL; CouchDB can provide you a piece of practical knowledge to understand the NoSQL database concept. A few features of CouchDB are enlisted below.

  • View DataBase
  • Setup Environment
  • API Facilities
  • DB Replications
  • Adaptability
  • Queries are Done via JavaScript
  • Cap Theorem
  • NoSQL
  • Map-Reduce System
  • DB Migration
  • Memcached

Install CouchDB on Linux


CouchDB is a non-relational database which is written in the Erlang programming language. It uses the Hypertext Transfer Protocol to interact between the database and the web-based interface. You can use CouchDB on cloud computing and server management. CouchDB is very much famous among the Apache server administrators.

Due to the durable storage engine, sync capability, mesh connectivity, and sub-database facilities, CouchDB is very much used in the server level platform. This post will show how you can install and configure the CouchDB on your Linux system.

1. Install CouchDB on Ubuntu Linux


To install CouchDB on Ubuntu and Debian based Linux systems, first; you need to update your system repository and install the common software repositories. You can use the following aptitude command-lines to install the software repositories.

sudo apt update && upgrade
sudo apt-get install software-properties-common

Now, we have to add the public key of the CouchDB on our system. Use the following cURL command-line to add the public key to your system. After adding the public key, you need to download the Debian package of CouchDB for your Ubuntu Linux.

sudo echo commands

curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add
echo "deb https://apache.bintray.com/couchdb-deb bionic main" |

Then you can check the source list by performing the following tee command.

sudo tee -a /etc/apt/sources.list

You can now update your system repository and install the CouchDB on your Ubuntu and other Debian Linux distributions.

sudo apt update
sudo apt install couchdb

By default, CouchDB uses port 5984. You can load the browser interface of CouchDB by entering the localhost address with the 5984 port.

curl http://127.0.0.1:5984/

You can now check the status of your CouchDB on your Linux system.

sudo systemctl status couchdb

2. Install CouchDB on Red Hat Linux and CentOS


Red Hat and CentOS users can install the CouchDB on their Linux system by using the following YUM commands. First, you need to install the extra packages for enterprise Linux (EPEL) packages on your system.

yum install epel-release-7-11.noarch.rpm

Then you should run the following terminal command to install the CouchDB on your Red Hat and CentOS Linux system.

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

Now, you have to create a file to add the Gnu Privacy Guard, configure the port, set an URL, and set the server name. You can use the following terminal command-line to create a repository file.

/etc/yum.repos.d/apache-couchdb.repo

Now, use the following script codes to configure the repository of CouchDB. You can copy and paste the codes. After you are done with the script, save and exit the file.

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

Finally, you can now install the CouchDB on your Red Hat and Red Hat-based Linux systems. Use the following YUM command to install the CouchDB on your system.

yum install couchdb

After the installation is done, you have to configure the CouchDB for your system. We will edit the INI configuration file to configure the CouchDB. You can run the following nano command to open the script.

sudo nano /opt/couchdb/etc/local.ini

Now, copy and paste the following lines inside your configuration script. After the configuration is done, save and exit the file.

[chttpd]
port = 5984
bind_address = 127.0.0.1

[admins]
admin = secret

After everything is done perfectly, you need to enable and start the CouchDB on your Linux system. Use the following system control commands to enable and start the CouchDB on your Red Hat Linux and CentOS.

systemctl enable couchdb.service
systemctl start couchdb.service

3. Install CouchDB on Arch Linux


There are two available methods to install CouchDB on Arch and Arch-based Linux. First, we will see the Snapcraft method; later, we will see how you can manually download the CouchDB and install it on your Arch Linux.

Method 1: Install CouchDB via the Snapcraft Commands


To install the CouchDB on our Arch Linux, we will use the Snapcraft store commands. First, we need to clone the Git of Arch Linux. Later, we will open the Snapd directory and make a package IRQ on our Arch Linux. You can use the following command-lines given below to clone the Git and make the package IRQ.

git clone https://aur.archlinux.org/snapd.git
cd snapd
makepkg -si

Now, use the following system control command to enable the Snap socket.

sudo systemctl enable --now snapd.socket

Now, run the following LN command to create a soft link between the Snap library and the Snap tool.

sudo ln -s /var/lib/snapd/snap /snap

Finally, run the following Snap command to install the CouchDB on your Arch Linux system.

sudo snap install couchdb

Method 2: Download and Install the CouchDB


On Arch and Arch-based Linux distributions, you can download the compressed file of CouchDB and install it manually with the package manager. You can use this link to download the compressed version of CouchDB for Arch Linux.

CouchDB on Linux arch

After the download is finished, open your Downloads directory and install the CouchDB by the Pacman tool.

cd Downloads/
ls
sudo pacman -U couchdb-3.1.1-1-x86_64.pkg.tar.zst

4. Install CouchDB on Fedora


To install CouchDB on Fedora Linux, we will use the Snap package store. First, we have to install the Snapd on our Fedora Linux. You can use the following terminal command given below to install the Snapd on your system.

sudo dnf install snapd

Then we will run the following LN command to create a soft link between the Snap library and the Snap tool.

CouchDB on Linux fedora

sudo ln -s /var/lib/snapd/snap /snap

Finally, run the following Snap command to install the CouchDB on your Fedora Linux system.

sudo snap install couchdb

5. Install CouchDB on SuSE Linux


To install CouchDB on SuSE and OpenSuSE Linux, we will use the Snap store along with the default zypper command. First, we will download the Snappy open source repositories for SuSE Linux. Later, we will add the GNU privacy key to the package. You can run the following terminal command-lines to download the repository and add the GPG key.

sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.2 snappy
sudo zypper --gpg-auto-import-keys refresh
sudo zypper dup --from snappy

Then, run the following zypper command to install the Snapd on your SuSE Linux.

sudo zypper install snapd

Then use the following command-lines given below to enable and start the Snap store on your SuSE Linux.

sudo systemctl enable snapd
sudo systemctl start snapd

You can also enable and start the Snap store for the mirror sites.

sudo systemctl enable snapd.apparmor
sudo systemctl start snapd.apparmor

Finally, run the following snap command to install the CouchDB on your SuSE and OpenSuSE Linux.

sudo snap install couchdb

Remove CouchDB


If you need to remove the CouchDB from your Ubuntu and other Debian Linux distributions, you can follow the terminal command-lines given below.

apt-get remove couchdb
apt-get purge couchdb

As we have used the Snap package management commands to install the CouchDB on various Linux distributions, we have to apply the standard Snap-removal processes to remove the CouchDB from Red Hat, Fedora, and other distributions.

sudo snap remove <packagename>

You can also use the Synaptic Package Manager to remove packages on your Linux machine.

Get Started with CouchDB


Till now, we have done the installation of CouchDB on our Linux distributions. To load the CouchDB’s web interface, we have to type the host address and the port that we configured for the CouchDB. In my case, the host is localhost, and the port is default 5984. We just need to type the following address in the address bar and then hit the enter button.

CouchDB on Linux web

localhost:5984

Final Words


CouchDB is a product of the Apache server. It is mostly used to maintain a database for a web server. The CouchDB is not a traditional and conventional database. We can’t compare it with MySQL or PostgreSQL. In the entire post, I have described how you can install CouchDB on your Linux distribution. Share this post if you find this post useful and informative. You can also write down your opinions regarding this post in the comment section.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

spot_img

Latest Post

Must Read