Read in 2 minutes

last updated 

How to Install CouchDB on Debian 9

CouchDB is an open-source fault-tolerant and schema-free NoSQL database maintained by the Apache Software Foundation.

CouchDB server stores its data in named databases which contains documents with JSON structure. Each document consists of a number of fields and attachments. Fields can include text, numbers, lists, booleans, more. It is accessible via a RESTful HTTP/JSON API that allows you to read, create, edit and delete database documents.

In this tutorial, we will explain how to install the latest version of CouchDB on Debian 9.

Prerequisites

To be able to install packages on your Debian system, you must be logged in as a user with sudo privileges.

Enabling CouchDB repository

CouchDB .deb packages are available from their official repositories. To enable the CouchDB repository and import GPG key, run the following commands:

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

Installing CouchDB on Denian

Once the repository is enabled update the packages list and install CouchDB:

sudo apt update
sudo apt install couchdb

The installer will first ask you whether you want to install CouchDB in a standalone or clustered mode. We will install the CouchDB in a single-server standalone mode.

Next, you’ll be given an option to set the IP address of the network interface on which the CouchDB will bind to. For single-server setup leave the default 127.0.0.0. If you are configuring a cluster enter the interface IP address or type 0.0.0.0 which will cause CouchDB to binds to all network interfaces.

On the next prompt set the admin password. It is highly recommended to set the password which will take CouchDB out of the insecure “admin party” mode. If you leave this field blank, the admin user will not be created.

Confirm the password and the CouchDB installation will continue.

Verifying CouchDB Installation

To verify the installation run the following curl command which will print the CouchDB database information in JSON format:

curl http://127.0.0.1:5984/

The output will look like below:

{  
   "couchdb":"Welcome",
   "version":"2.3.1",
   "git_sha":"c298091a4",
   "uuid":"370903b5400643c2979838f5b68348c1",
   "features":[  
      "pluggable-storage-engines",
      "scheduler"
   ],
   "vendor":{  
      "name":"The Apache Software Foundation"
   }
}

For clarity the output is formatted.

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

http://127.0.0.1:5984/_utils/

Conclusion

You have learned how to install CouchDB Debian 9. Your next step could be to visit the Apache CouchDB Documentation and find more information on this topic.