How to Install Apache CouchDB on Ubuntu 18.04 LTS

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:

Install CouchDB with apt

Use standalone mode

Bind CouchDB to network address

Set a password

Repeat the password

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:

CouchDB web interface

Now, provide your admin username and password, then click on the Login button, you should see the following page:

CouchDB database management interface

Hitesh Jethva

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.

Share this page:

Suggested articles

5 Comment(s)

Add comment

Comments

By: Chinaedu at: 2018-06-21 13:31:49

You are defining xenial here: 'echo "deb https://apache.bintray.com/couchdb-deb xenial main" \ | sudo tee -a /etc/apt/sources.list' But the title is how to install CDB for Ubuntu 18.04, so should be bionic?

By: Scott Whittaker at: 2018-07-27 00:22:39

Yes, as of July 11 official bionic sources are available. Just replace xenial with bionic in the above and you should be good to go. If you have already added the xenial sources you'll need to remove the entry otherwise it will look there first. I had errors with dependencies using the xenial sources.

By: Scott Whittaker at: 2018-07-26 21:42:42

curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \ | sudo apt-key add -

Results in

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  3100  100  3100    0     0   1994      0  0:00:01  0:00:01 --:--:--  1993

 

curl: (3) Host name ' ' contains bad letter

then

 

sudo apt-get install couchdb -y

results in

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:

 

The following packages have unmet dependencies:

 couchdb : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed

           Depends: libicu55 (>= 55.1-1~) but it is not installable

           Recommends: python-progressbar but it is not going to be installed

 

E: Unable to correct problems, you have held broken packages.

By: Scott Whittaker at: 2018-07-26 22:42:20

Hi, just an update to let you know that I've found some official bionic sources. So you can use the same commands above, replacing xenial with bionic and you should be good to go. However if you've already added the xenial source you'll need to remove it first.

By: Edwin at: 2018-09-08 01:25:04

Still don't understand this Scott. Your last post is generating the same libcurl3 error that I am getting, even after the Xenial fix to sources. I can't understand why couchdb is so difficult to install....