In this article, I will discuss how to install and use Apache CouchDB in Ubuntu Linux.
You should have access to a user account with root user privileges to install required packages.
Installing CouchDB in Ubuntu
We will install CouchDB from its official repository. For this, we need to enable the CouchDB repository on our system.
First, install the required packages and dependencies by using –
sudo apt update && sudo apt install -y curl apt-transport-https gnupg
Use the following command to import the GPG key of the CouchDB repository –
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1
Next, enable the repository by using the given command –
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ focal main" \ | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null
Refresh the local package repository list with –
sudo apt update
Finally use the following command to install CouchDB on your system.
sudo apt install couchdb
When ask for your confirmation type y and then press enter.
The installer will ask you to choose between standalone or clustered mode. We will install it in standalone mode, a clustered mode is when there are multiple servers are connected together.
Next, it will ask you to enter the IP address, for standalone systems by default it is 127.0.0.1. If you want to bind all network interfaces then use 0.0.0.0.
In the next window enter the password for the CouchDB ‘admin’ user.
Enter your password once again.
Verify the CouchDB installation
Once the installation is completed you can verify whether it was successfully installed on your system or not. The CouchDB server uses port 5984, now use the following command to verify CouchDB installation.
This will display the following output in JSON format.
Access CouchDB web interface
Open a browser and enter the given URL to access the web interface of CouchDB.
Here you can log in to the CouchDB database as administrator by entering admin as username and password.
To know more about CouchDB you can read Apache CouchDB documentation. For any query write us in the comments below.