fbpx
How to Install CouchDB on Ubuntu 22.04

In this article, we will provide a detailed guide on how to install CouchDB on Ubuntu 22.04. Data management is now one of the most important aspects of any business, especially with the advent of the digital age. This is where database management systems like CouchDB are useful. The Apache Software Foundation created Apache CouchDB, a NoSQL database that is open-source and free. It is a popular option for web developers because of its scalability and reputation for simplicity of use.

What is CouchDB

CouchDB is a document-oriented NoSQL database that uses JSON to store data, JavaScript as its query language, and HTTP for an API. It offers distributed scaling with fault-tolerant storage, allowing you to use and serve data with ease.

Prerequisites

Before installing CouchDB on Ubuntu 22.04, make sure you have:

Installation Steps

Let’s move on to the step-by-step guide on installing CouchDB on Ubuntu 22.04.

Step 1: Update Your System

Your system packages must be updated to the newest version. Run the following command:

sudo apt-get update && sudo apt-get upgrade

Step 2: Install Software Properties Common Package

Next, install the software-properties-common package. This package provides an abstraction of the used apt repositories and allows you to manage distribution and independent software vendor software sources easily. Use the following command:

Step 3: Add CouchDB Repository

After installing the software-properties-common package, import the GPG key. Run the following command:

curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null

Then, using the signed-by option to specify the keyring file, we will add the CouchDB on Ubuntu repository:

echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/couchdb.list

Step 4: Install CouchDB on Ubuntu

Now, you’re ready to install CouchDB. Use the following command:

sudo apt-get update && sudo apt-get install couchdb

During the installation, you’ll be asked to select the type of CouchDB installation. You can choose between a standalone or clustered setup. If you’re installing CouchDB on a single server, select ‘standalone’. For multiple servers, select ‘clustered’. If your CouchDB instance is a standalone installation, you can input any string value as the cookie. This value will not matter unless you are setting up a cluster of CouchDB instances.

If you are setting up a cluster, make sure to use the same cookie value on all nodes. This is important because nodes in a CouchDB cluster use the same Erlang cookie to communicate with each other.

After you’ve entered your desired cookie value, you can proceed with the installation.

Step 5: Configure CouchDB on Ubuntu

After successful installation, open your web browser and navigate to http://localhost:5984/_utils/. This will open the CouchDB interface, Fauxton. Here, you can configure your CouchDB installation further.

To allow external access, you need to modify the CouchDB configuration file to bind the HTTP server to all network interfaces.

Open the local.ini file with a text editor:

sudo nano /opt/couchdb/etc/local.ini

Find the section [chttpd] and change the bind_address from 127.0.0.1 to 0.0.0.0:

[chttpd]
port = 5984
bind_address = 0.0.0.0

Save the file and exit the text editor.

Restart CouchDB for the changes to take effect:

sudo systemctl restart couchdb

Now, you should be able to access the CouchDB web interface from any machine in your network using the server IP address and port 5984. Make sure your network allows inbound connections to this port.

How to Install CouchDB on Ubuntu 22.04

Verifying the Installation

To verify the installation of CouchDB, use the curl command:

curl http://127.0.0.1:5984/

If the installation is successful, you’ll get a response similar to this:

curl http://81.181.27.8:5984/
{"couchdb":"Welcome","version":"3.3.2","git_sha":"11a234070","uuid":"db4a4dee584977354d66c0eecf184718","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

Final Thoughts

Installing CouchDB on Ubuntu 22.04 is a straightforward process if you follow the steps outlined in this guide. With CouchDB, you can easily manage your data with its user-friendly interface and robust performance. Whether you’re a seasoned developer or a beginner, this guide will help you get CouchDB up and running on your Ubuntu 22.04 system.


1 Comment

How To Install Neo4j On Ubuntu 22.04 - Virtono Community · September 19, 2023 at 9:26 AM

[…] providing a reliable and effective way to manage and query highly connected data. This open-source, NoSQL, native graph database provides an excellent foundation for all kinds of applications that need to […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.