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.
To install CouchDB, follow the steps outlined below.
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
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
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.
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.
This article covers how to install CouchDB on Ubuntu Linux System. Apache offers us various options for working with data and information on the web and one of its many derivations is Apache CouchDB.
CouchDB is a popular NoSQL database developed and maintained by Apache Foundation since 2005.
It is an open-source database written in Erlang language that provides a RESTful API that users can use to create and modify database objects.
Main Features of CouchDB:
1. CouchDB has a clustered database, thus allowing you to run a logical database server regardless of the number of servers or virtual machines.
2. By using apache CouchDB we have a single node database which acts under an application server.
3. It makes use of the HTTP protocol and the JSON data format, being compatible with any software that supports them.
4. CouchDB's unique replication protocol generates "Offline First" applications for mobile applications and other environments that have infrastructure
high impact network.
To install Apache CouchDB on Ubuntu:
1. Enable the Apache CouchDB repository, for this we download and install the GPG key with the following command:
$ curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
2. Now we add the repository, for this we execute:
$ sudo nano /etc/apt/sources.list
3. At the bottom we add the line:
deb https://apache.bintray.com/couchdb-deb focal main
4. We save the changes using the following key combination:
Ctrl + O
And exit the editor using:
Ctrl + X
5. We update the operating system with the following command.
$ sudo apt update
6. Next, we install Apache CouchDB:
$ sudo apt install apache2 couchdb
To see the status of Apache CouchDB, run the command:
$ sudo systemctl status couchdb.service