How to install CouchDB on Ubuntu 20.04

s2 0

Apache CouchDB is a free, open source NoSQL database developed by the Apache Software Foundation. It can be used as a single node or cluster database.

The CouchDB server saves its data in named databases, the documents with JSON
Structure. Each document consists of a number of fields and attachments. Fields can contain text, numbers, lists, Boolean values, and more. CouchDB includes a RESTful HTTP API that you can use to read, create, edit and delete database documents.

This article covers the steps to install the latest version of CouchDB on Ubuntu 20.04.

Installing CouchDB on Ubuntu is relatively easy. We activate the CouchDB APT repository, import the GPG key of the repository and install the CouchDB package.

Activate the CouchDB repository

Run the following commands as root or user with sudo privileges to activate the CouchDB repository and import the GPG key:

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

Install CouchDB on Ubuntu

Once the repository is activated, update the package list and install CouchDB:

sudo apt updatesudo apt install couchdb

The installer asks you whether you want to install CouchDB in cluster or standalone mode. A cluster means that multiple servers are interconnected and function as a single, distributed data store.

We will be installing CouchDB in a single server standalone mode.

Next you will be given the option to set the IP address of the network interface that the CouchDB will bind to. For a single server setup, leave the default setting 127.0.0.1. If you are configuring a cluster, enter the IP address or the type of interface 0.0.0.0, which tells CouchDB to bind to all network interfaces.

At the next prompt, set the administrator password. It is strongly recommended to set the password that CouchDB gets out of the insecure “Admin Party” mode. If you leave this field blank, no admin user will be created.

Finally, confirm the password and the CouchDB installation will continue.

Check the CouchDB installation

The CouchDB server runs under localhost:5984. To verify that the installation was successful and the service is running, do the following: curl
Command that outputs information about the CouchDB database in JSON format:

curl https://127.0.0.1:5984/

The output looks like this:

{
  "couchdb":"Welcome",
  "version":"3.1.0",
  "git_sha":"ff0feea20",
  "uuid":"4589130c33b0dae4c166330463542ad4",
  "features":[
    "access-ready",
    "partitioned",
    "pluggable-storage-engines",
    "reshard",
    "scheduler"
  ],
  "vendor":{
    "name":"The Apache Software Foundation"
  }
}

For the sake of clarity, the above output is formatted.

If you prefer a GUI, you can access CouchDB’s web-based interface, Fauxton, at:

https://127.0.0.1:5984/_utils/

diploma

We showed you how to install CouchDB on Ubuntu 20.04. More information on this topic can be found in the Apache CouchDB documentation
.

Feel free to leave a comment if you have any questions.