How to Install CouchDB on Ubuntu Linux

|

|

This tutorial provides an easy guide on installing Apache CouchDB, a general-purpose NoSQL database server, on Ubuntu 20.04 | 18.04. The reader is guided through the processes of adding the Apache CouchDB repository to Ubuntu, running commands and selecting configuration options, and finally accessing Apache CouchDB via a specified IP/port combination.

This brief tutorial shows students and new users how to install CouchDB on Ubuntu 20.04 | 18.04.

CouchDB is a popular NoSQL database server used by many businesses and organizations. It is a stable and reliable database system with high-performance data storage capabilities. Ubuntu Linux is a popular operating system widely used by developers, businesses, and individuals.

Installing CouchDB on Ubuntu Linux provides a powerful platform for developing and deploying applications that require a robust and scalable database solution.

Additionally, Ubuntu is known for its ease of use and excellent community support, making it an ideal choice for developers and users looking for a reliable and user-friendly platform for their applications.

To learn how to install Apache CouchDB Ubuntu, follow the steps below

Add CouchDB Repository to Ubuntu

Adding the Apache CouchDB repository to Ubuntu is easy. You must run the commands below to add the repository key. The key is there to authenticate and validate packages from the repository.

Run the commands below to add the repository key and the repository.

sudo apt install curl
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
echo "deb https://apache.bintray.com/couchdb-deb focal main" | sudo tee -a /etc/apt/sources.list

When you’re done, continue below.

Update and Install Apache CouchDB

Now that the repository and key have been added run the commands below to update and install the latest Apache CouchDB packages.

To install Apache CouchDB, run the commands below

sudo apt update
sudo apt-get install apache2 couchdb

During the installation, you should see messages to select some options.

 ┌──────────────────────────┤ Configuring couchdb ├──────────────────────────┐
 │                                                                           │ 
 │ Please select the CouchDB server configuration type that best meets your    
 │ needs.                                                                      
 │                                                                             
 │ For single-server configurations, select standalone mode. This will set     
 │ up CouchDB to run as a single server.                                       
 │                                                                             
 │ For clustered configuration, select clustered mode. This will prompt for    
 │ additional parameters required to configure CouchDB in a clustered          
 │ configuration.                                                              
 │                                                                             
 │ If you prefer to configure CouchDB yourself, select none. You will then     
 │ need to edit /opt/couchdb/etc/vm.args and /opt/couchdb/etc/local.d/*.ini    
 │ yourself. Be aware that this will bypass *all* configuration steps,         
 │ including setup of a CouchDB admin user - leaving CouchDB in "admin         
 │                                                                             
 │                                <Ok>                                         
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘                                                                              

Next, select a standalone option and continue.

                  ┌─────────┤ Configuring couchdb ├─────────┐
                  │ General type of CouchDB configuration:  │ 
                  │                                         │ 
                  │               standalone                │ 
                  │               clustered                 │ 
                  │               none                      │ 
                  │                                         │ 
                  │                                         │ 
                  │                 <Ok>                    │ 
                  │                                         │ 
                  └─────────────────────────────────────────┘                                                               

Next, type in the interface IP address and continue.

  ┌─────────────────────────┤ Configuring couchdb ├──────────────────────────┐
  │ A CouchDB node must bind to a specific network interface. This is done   │ 
  │ via IP address. Only a single address is supported at this time.         │ 
  │                                                                          │ 
  │ The special value '0.0.0.0' binds CouchDB to all network interfaces.     │ 
  │                                                                          │ 
  │ The default is 127.0.0.1 (loopback) for standalone nodes, and 0.0.0.0    │ 
  │ (all interfaces) for clustered nodes. In clustered mode, it is not       │ 
  │ allowed to bind to 127.0.0.1.                                            │ 
  │                                                                          │ 
  │ CouchDB interface bind address:                                          │ 
  │                                                                          │ 
  │ 127.0.0.1_______________________________________________________________ │ 
  │                                                                          │ 
  │                           <Ok>                                           │ 
  │                                                                          │ 
  └──────────────────────────────────────────────────────────────────────────┘                                                                                

After that, type and confirm the admin password and complete the installation. After installing Apache CouchDB, the commands below can be used to stop, start, enable, and check its status.

sudo systemctl stop couchdb.service
sudo systemctl start couchdb.service
sudo systemctl enable couchdb.service
sudo systemctl status couchdb.service

This is what the status command shows

Executing /lib/systemd/systemd-sysv-install enable couchdb
richard@ubuntu1604:~$ sudo systemctl status couchdb.service
● couchdb.service - Apache CouchDB
   Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: 
   Active: active (running) since Wed 2018-06-20 15:34:51 CDT; 14s ago
 Main PID: 3788 (beam)
   CGroup: /system.slice/couchdb.service
           ├─3788 /opt/couchdb/bin/./erts-7.3/bin/beam -K true -A 16 -Bd -- -ro
           ├─3800 /opt/couchdb/bin/./erts-7.3/bin/epmd -daemon
           ├─3818 sh -s disksup
           ├─3820 /opt/couchdb/bin/./lib/os_mon-2.4/priv/bin/memsup
           └─3821 /opt/couchdb/bin/./lib/os_mon-2.4/priv/bin/cpu_sup

Jun 20 15:34:51 ubuntu1604 systemd[1]: Started Apache CouchDB.
lines 1-12/12 (END)

Access Apache CouchDB

After installing CouchDB, you can now open your browser and browse to the server hostname or IP address followed by port # 5984

http://127.0.0.1:5984/_utils/

Type in the admin username and password.

Enjoy!

CouchDB Ubuntu install

You may also like the post below:

Like this:



One response to “How to Install CouchDB on Ubuntu Linux”

  1. Joshua Byrd Avatar
    Joshua Byrd

    This seemed to be the only thing that worked for me

    sudo snap install couchdb

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.