How to Install Apache CouchDB in Ubuntu 20.04

Implemented in Erlang, Apache CouchDB, simply referred to as CouchDB, is an open-source NoSQL database that focuses on data storage in JSON format. CouchDB is a perfect choice for operation teams and businesses looking for a high-performance NoSQL database solution. Unlike relational databases such as MySQL, CouchDB uses a schema-free data model, simplifying records management across various computing devices.

This tutorial shows you how to install the latest version of Apache CouchDB on Ubuntu 20.04.

Step 1: Enable the CouchDB Repository

To start off, log in to your server instance and import the GPG key as shown.

$ curl -L   | sudo apt-key add -

Next, be sure to enable the CouchDB repository as shown.

$ echo "deb focal main" >> /etc/apt/sources.list

Once the repository and key are added, proceed to the next step.

Step 2: Install Apache CouchDB in Ubuntu

Having enabled the CouchDB repository, the next step will be to update the package lists of Ubuntu and install Apache CouchDB as shown.

$ sudo apt update
$ sudo apt install apache2 couchdb -y
Install CouchDB in Ubuntu
Install CouchDB in Ubuntu

You will need to select options to configure your CouchDB. In this prompt, you configure either in standalone or clustered mode. Since we are installing on a single server, we will opt for the single-server standalone option.

Configure CouchDB in Ubuntu
Configure CouchDB in Ubuntu

In the next prompt, you are supposed to configure the network interface on which the CouchDB will bind to. In standalone server mode, the default is (loopback).

Configure CouchDB Network Interface
Configure CouchDB Network Interface

If it’s the clustered mode, enter the interface IP address of the server or type, which binds CouchDB to all network interfaces.

Configure CouchDB Interface for Cluster Mode
Configure CouchDB Interface for Cluster Mode

Next, set the admin password.

Set CouchDB Admin Password
Set CouchDB Admin Password

Confirm the set password to finalize your installation.

Step 3: Verify CouchDB Installation

The CouchDB server listens to TCP port 5984 by default. To quench your curiosity, run the netstat command as shown.

$ netstat -pnltu | grep 5984

To verify whether the installation was successful and the service is running, run the curl command below. You should get the following information about the CouchDB database which is printed in JSON format.

$ curl

The output in your terminal will look like this:

Verify CouchDB Installation
Verify CouchDB Installation

Step 4: Access CouchDB Web Interface

You can open your browser and browse to and type in the admin username and password to login to your database:

CouchDB Login
CouchDB Login

After Apache CouchDB is successfully configured and installed, use the commands below to start, enable, stop, and check its status.

$ sudo systemctl start couchdb.service
$ sudo systemctl enable couchdb.service
$ sudo systemctl stop couchdb.service

The check status command shows:

$ sudo systemctl status couchdb.service
Check CouchDB Status
Check CouchDB Status

For more information on CouchDB, refer to the Apache CouchDB Documentation. It’s our hope that you can now comfortably install CouchDB on Ubuntu 20.04.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Winnie Ondara
My name is Winnie, a Linux enthusiast and passionate tech writer in Linux and DevOPs topics. I enjoy keeping abreast with the latest technologies in the Linux ecosystem and trying out new tools provided by the FOSS community.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.