Ubuntu

Install CouchDB on Ubuntu 20.04

Install-CouchDB-Ubuntu-20-04

CouchDB is a popular NoSQL database developed and maintained by Apache Foundation since 2005. It is an open-source database written in Erlang language that provides a RESTful API that users can use to create and modify database objects. CouchDB provides a document-oriented architecture and presents data as key-value pairs.

Now, let us install CouchDB on Ubuntu 20.04 LTS.

Step 1: Install prerequisite packages

The first step involves installing the prerequisite packages that will be required later in the installation. To run the following command:

$ sudo apt install curl

Next, Install the GPG key for encryption and signing of data.

$ sudo apt install gnupg ca-certificates -y

Step 2: Enable CouchDB repository

Before you enable the CouchDB repository, be sure to install the repository key as follows:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61

Then add CouchDB repository to the sources list file as follows:

$ echo "deb https://apache.bintray.com/couchdb-deb focal main" >> /etc/apt/sources.list

Once you have added the CouchDB repository, update the package lists to sync the repository.

$ sudo apt update

Step 3: Install couchDB

You can now proceed to install CouchDB as follows as a sudo user.

$ sudo apt install couchdb

The installation requires you to select the CouchDB configuration mode. There are two types of configuration:

  1. Standalone mode: This is used when dealing with a single server instance.
  2. Clustered: As the name suggests, this is used when you have multiple servers that are interconnected.

Since this guide demonstrates the installation on a single server, we will go with the ‘Standalone’ option.

Next, be sure to specify the bind-address. By default, this is set to the localhost address which is just okay for a standalone server. Just press ENTER.

Next, set a strong password for the Admin user.

Confirm the password and hit ENTER.

Afterward, the installation will continue running and complete.

Step 4: Test couchDB

To verify that the installation went as expected, use the curl command to retrieve basic information about CouchDB in JSON format;

$ curl http://127.0.0.1:5984

You will get a set of output as indicated below

CouchDB listens to port 5984 and you can confirm this by initiating the command:

$ sudo netstat -pnltu | grep 5984

When CouchDB is installed, two databases are created by default. These are replicator and users databases. To verify this, browse the URL below:

http://127.0.0.1:5984/_utils

Provide the login details with ‘admin’ as the username and the password that you provided during the installation process in Step 3.

This ushers you to the couchDB database below.

Those two tests confirm that CouchDB is successfully installed. Bravo!

Hopefully, you are now in a comfortable position to install CouchDB on your system.

Similar Posts