Apache CouchDB gives us the opportunity to have access to information from different places, since it is based on the Couch Replication Protocol, which is compatible with global server clusters, mobile phones or web browsers, which gives the ease of secure access . Web and native applications are 100% compatible with CouchDB as its default language is JSON and supports binary data for data storage.
CouchDB provides a document-oriented architecture and presents data as key-value pairs.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Ubuntu Software Installation tasks.
In this context, we shall look into how to install CouchDB on Ubuntu 20.04 LTS.
How to install CouchDB on Ubuntu ?
To install CouchDB, follow the steps outlined below.
1. Install prerequisite packages
The first step involves installing the prerequisite packages that will be required later in the installation.
To do this, run the following command:
$ sudo apt install curl
Next, Install the GPG key for encryption and signing of data:
$ sudo apt install gnupg ca-certificates -y
2. Enable CouchDB repository
Before you enable the CouchDB repository, be sure to install the repository key as follows:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61
Then add CouchDB repository to the sources list file as follows:
$ echo "deb https://apache.bintray.com/couchdb-deb focal main" >> /etc/apt/sources.list
Once you have added the CouchDB repository, update the package lists to sync the repository:
$ sudo apt update
3. Install couchDB
You can now proceed to install CouchDB as follows as a sudo user:
$ sudo apt install couchdb
The installation requires you to select the CouchDB configuration mode.
There are two types of configuration:
i. Standalone mode: This is used when dealing with a single server instance.
ii. Clustered: As the name suggests, this is used when you have multiple servers that are interconnected.
Here, we will focus on 'Standalone' option since the installation is being done on a single server.
Next, be sure to specify the bind-address. By default, this is set to the localhost address which is just okay for a standalone server. Just press ENTER.
Next, set a strong password for the Admin user.
Confirm the password and hit ENTER.
Afterward, the installation will continue running and complete.
4. Test couchDB
To verify that the installation went as expected, use the curl command to retrieve basic information about CouchDB in JSON format:
$ curl http://127.0.0.1:5984
CouchDB listens to port 5984 and you can confirm this by initiating the command:
$ sudo netstat -pnltu | grep 5984
When CouchDB is installed, two databases are created by default. These are replicator and users databases.
To verify this, browse the URL below:
Provide the login details with 'admin' as the username and the password that you provided during the installation process in third step.
This will take you to the couchDB database section.
The tests confirm that CouchDB is successfully installed.
[Need urgent assistance in fixing missing packages on Ubuntu Server? We are available to help you. ]