How to Install Apache CouchDB on Ubuntu 18.04 LTS
This tutorial exists for these OS versions
- Ubuntu 20.04 (Focal Fossa)
- Ubuntu 18.04 (Bionic Beaver)
On this page
CouchDB is a free and an open source NOSQL database solution implemented in the concurrency-oriented language Erlang. It has a document-oriented NoSQL database architecture. It uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API. CouchDB implements a form of multi-version concurrency control, so it does not lock the database file during writes. You can use CouchDB in mobile devices for replication and synchronization.
In this tutorial, we will learn how to install CouchDB on Ubuntu 18.04 LTS (Bionic Beaver) server.
Requirements
- A server running Ubuntu 18.04.
- A non-root user with sudo privileges.
Install Apache
Before starting, you will need to install Apache web server to your system. You can install it by just running the following command:
sudo apt-get install apache2 -y
Once Apache is installed, start Apache web server and enable it to start on boot time by running the following command:
sudo systemctl start apache2
sudo systemctl enable apache2
Install CouchDB
By default, Apache CouchDB is not available in Ubuntu 18.04, so you will need to add the official repository of CouchDB. First, add the repository using the following command:
echo "deb https://apache.bintray.com/couchdb-deb xenial main" \ | sudo tee -a /etc/apt/sources.list
Next, sign the added repository with the following command:
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \ | sudo apt-key add -
Finally, update the CouchDB repository and install it with the following command:
sudo apt-get update -y
sudo apt-get install couchdb -y
During the installation, you will prompt you for some initial configuration as shown below:
Once the installation is finished. Start CouchDB and enable it to start on boot time using the following command:
sudo systemctl start couchdb
sudo systemctl enable couchdb
You can check the status of CouchDB using the following command:
sudo systemctl status couchdb
Output:
? couchdb.service - Apache CouchDB Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: Active: active (running) since Sun 2018-06-10 20:22:25 IST; 45s ago Main PID: 3092 (beam) CGroup: /system.slice/couchdb.service ??3092 /opt/couchdb/bin/../erts-7.3/bin/beam -K true -A 16 -Bd -- -ro ??3119 /opt/couchdb/bin/../erts-7.3/bin/epmd -daemon ??3145 sh -s disksup ??3149 /opt/couchdb/bin/../lib/os_mon-2.4/priv/bin/memsup ??3150 /opt/couchdb/bin/../lib/os_mon-2.4/priv/bin/cpu_sup Jun 10 20:22:25 Node1 systemd[1]: Started Apache CouchDB. Jun 10 20:23:01 Node1 systemd[1]: Started Apache CouchDB. Jun 10 20:23:04 Node1 systemd[1]: Started Apache CouchDB.
Access CouchDB Web Interface
CouchDB is now started and listening on port 5984. You can access it by visiting the URL http://your-server-ip:5984/_utils/, you will be redirected to the following page:
Now, provide your admin username and password, then click on the Login button, you should see the following page: