Cloud Database Software Concept - 3D Illustration
Image: ArtemisDiana/Adobe Stock

CouchDB is an open-source NoSQL database server that is developed by the Apache Software Foundation and uses multiple formats and protocols to store, transfer and process data. CouchDB uses JSON to store data, JavaScript as its query language and HTTP as an API. CouchDB also includes a web-based GUI tool, called Fauxton, to create and manage your databases.

Although MongoDB is faster than CouchDB, CouchDB does offer mobile support and replication, works with map-reduce functions, and supports both stand-alone and cluster deployments. One of the key differences between CouchDB and other databases is that it offers a flexible format for the storage of information.

Some of the more attractive features of CouchDB include the following:

  • Easy database replication across multiple servers
  • Fast indexing and retrieval
  • REST-like interface
  • JSON-based document format
  • Multiple supported libraries
  • Subscribable data updates on the _changes feed

I want to walk you through the process of installing CouchDB on Debian 11 Server. The process is fairly straightforward and shouldn’t take you more than five minutes to complete. I’ll demonstrate installing CouchDB in stand-alone mode (in a later piece I’ll walk you through deploying CouchDB as a cluster).

SEE: Hiring Kit: Database engineer (TechRepublic Premium)

What you’ll need

Since we’re going to install this in stand-alone mode, you’ll only need one instance of Debian Server and a user with sudo privileges.

How to install the dependencies

The first thing we’ll do is install the necessary dependencies. Log into your Debian server, and issue 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 the installation, you’ll be prompted to configure CouchDB. First, you must select the type of configuration that meets your needs. Since we’re installing in stand-alone mode, make sure to select the correct option, tab down to OK, and hit Enter (Figure A).

Figure A

Image: Jack Wallen/TechRepublic. Select stand-alone mode for our demonstration.

Next, you’ll be required to type a cookie name (Figure B), which is used for all nodes in a cluster. Type anything you like here (such as trtest), tab down to OK, and hit Enter.

Figure B

Image: Jack Wallen/TechRepublic. If you intend on adding this to a cluster, you’ll need to remember that cookie.

In the next window (Figure C), you’ll want to replace with, so you can access the web-based GUI.

Figure C

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

Finally, you must type 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 will finish, and you’re ready to access the web-based GUI.

How to access the web-based 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). You will be presented with a login window (Figure E), where you’ll type the username admin and the password you created during the installation.

Figure E

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

Once you’ve successfully authenticated, you’ll be presented with the main CouchDB web GUI, where you can start building your databases.

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

Want to learn more about Apache? Try The Complete Big Data eBook & Video Course Bundle in TechRepublic Academy.

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

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays