How to Install CouchDB NoSQL Database on Debian Server 11

Jack Wallen shows you how to install the CouchDB NoSQL database server and how to access its web GUI.

Image: ArtemisDiana/Adobe Stock

CouchDB is an open source NoSQL database server developed by the Apache Software Foundation and uses several formats and protocols to store, transfer and process data. CouchDB uses JSON to store data, JavaScript as query language, and HTTP as API. CouchDB also includes a graphical, web-based tool called Fauxton for creating and managing your databases.

Although MongoDB is faster than CouchDB, CouchDB offers mobile support and replication, works with map shrink functions, and supports standalone and clustered deployments. One of the main differences between CouchDB and other databases is that it offers a flexible format for storing information.

Some of CouchDB’s most attractive features include the following:

  • Easy database replication across multiple servers
  • Fast indexing and retrieval
  • REST-like interface
  • JSON-based document format
  • Multiple Libraries Supported
  • Data updates you can subscribe to on the _changes feed

I want to walk you through the process of installing CouchDB on Debian 11 server. The process is quite simple and shouldn’t take you more than five minutes. I will demonstrate installing CouchDB in standalone mode (in a later post I will explain how to deploy CouchDB as a cluster).

SEE: Recruitment Kit: Database Engineer (TechRepublic Premium)

What you will need

Since we will be installing it in standalone mode, you will only need a single Debian Server instance and a user with sudo privileges.

How to install dependencies

The first thing we are going to do is install the necessary dependencies. Connect to your Debian server and run the command:

sudo apt-get install -y curl apt-transport-https gnupg nano lsb-release -y

How to add the CouchDB repository

Next, we’ll add the CouchDB repository. First, add the GPG key with:

curl | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1

Then add the repository with the command:

echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null

How to install CouchDB

Finally, we can install CouchDB with the commands:

sudo apt-get update
sudo apt-get install couchdb -y

During installation, you will be prompted to configure CouchDB. First, you need to select the type of configuration that meets your needs. Since we are installing in standalone mode, make sure you select the correct option, press OK and press Enter (Figure A).

Figure A

Image: Jack Wallen/TechRepublic. Select standalone mode for our demonstration.

Next, you will need to enter a cookie name (Figure B), which is used for all nodes in a cluster. Type whatever you want here (like trtest), tab to OK and hit enter.

Figure B

Image: Jack Wallen/TechRepublic. If you intend to add it to a cluster, you will need to remember this cookie.

In the next window (Figure C), you will want to replace with you can access the web GUI.

Figure C

Image: Jack Wallen/TechRepublic. Configuring the IP address to which the server will bind.

Finally, you must enter and verify a password for the admin user (Figure D).

Figure D

Image: Jack Wallen/TechRepublic. Set a strong/unique password for the admin user.

The installation completes and you are ready to access the web GUI.

How to Access the Web GUI

Open a web browser and point it to http://SERVER:5984/_utils/ (where SERVER is the IP address or domain of the hosting server). A login window will appear (Figure E), where you will enter the admin username and password you created during installation.

Figure E

Image: Jack Wallen/TechRepublic. The CouchDB login prompt.

Once you have successfully authenticated, you will be presented with the main CouchDB web GUI, where you can begin creating your databases.

Congratulations, you now have a running instance of the CouchDB NoSQL database server. Next time we will deploy a CouchDB cluster for even more power.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech tips for professionals from Jack Wallen.