How to Install Apache CouchDB on Ubuntu Linux

|

|

Apache CouchDB, a high-performance NoSQL database server adaptable with multiple programming languages, can be installed on Ubuntu through a set of commands. This installation includes adding the Apache CouchDB repository, updating, choosing configuration type, entering an IP address, and setting an admin password. The database can be accessed in a browser using the server IP…

This article explains how to install Apache CouchDB on Ubuntu Linux.

Apache CouchDB is a powerful NoSQL database server that can be easily installed on Ubuntu Linux. It is great for professionals and businesses looking for a high-performance database system.

Some of the benefits of installing Apache CouchDB on Ubuntu Linux include:

  1. Open-source: Apache CouchDB is an open-source software tool that is free to use and modify. This means that you can install it on as many computers as you want without paying any licensing fees.
  2. High-performance: Apache CouchDB is designed to handle large amounts of data quickly and efficiently. It is scalable, meaning it can grow with your business and handle increasing data as your needs change.
  3. Easy to install: Installing Apache CouchDB on Ubuntu Linux is straightforward and can be done in just a few steps. This makes it an excellent choice for beginners just starting with databases.
  4. Customizable: Apache CouchDB can be customized to meet your specific needs. You can add custom functions using different programming languages such as Erlang, C/C++, Java, etc. In addition, it uses JSON natively and supports binaries for all your data storage needs.
  5. Stable: Apache CouchDB is a stable and reliable database system used by major corporations and businesses. It is often considered a better choice than other database systems, such as MySQL and MariaDB, for professionals who require a stable and high-performance database system.

Overall, if you are looking for a high-performance and customizable database system, Apache CouchDB is a great choice.

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

Add Apache CouchDB Repository to Ubuntu

Adding the Apache CouchDB repository to Ubuntu is easy. All you have to do is 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 xenial main" \ | sudo tee -a /etc/apt/sources.list.d/apache_couchdb_xenial.list
echo "deb https://apache.bintray.com/couchdb-deb bionic main" \ | sudo tee -a /etc/apt/sources.list.d/apache_couchdb_bionic.list

When you’re done, continue below.

Update and Install Apache CouchDB

Once the repository and key are 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

Accessing 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!

You may also like the post below:

Like this:



5 responses to “How to Install Apache CouchDB on Ubuntu Linux”

  1. rmarbach Avatar
    rmarbach

    The install on 18.04 LTS linode server does not work for me. after running the following commands
    curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \
    | sudo apt-key add –

    echo “deb https://apache.bintray.com/couchdb-deb bionic main” \
    | sudo tee -a /etc/apt/sources.list.d/apache_couchdb_bionic.list

    rmarbach@plts1:~$ sudo apt install apache2 couchdb
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package couchdb is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘couchdb’ has no installation candidate
    rmarbach@plts1:~$

  2. rmarbach Avatar
    rmarbach

    PS, I did run the following commands after update the repository as shown in my previous post
    rmarbach@plts1:~$ sudo apt update
    Hit:1 http://mirrors.linode.com/ubuntu bionic InRelease
    Hit:2 http://mirrors.linode.com/ubuntu bionic-updates InRelease
    Hit:3 http://mirrors.linode.com/ubuntu bionic-backports InRelease
    Ign:4 https://apache.bintray.com/couchdb-deb bionic InRelease
    Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
    Get:6 https://apache.bintray.com/couchdb-deb bionic Release [1,840 B]
    Fetched 85.1 kB in 1s (113 kB/s)
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    All packages are up to date.
    rmarbach@plts1:~$ sudo apt install couchdb
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package couchdb is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘couchdb’ has no installation candidate
    rmarbach@plts1:~$

  3. alif satria Avatar
    alif satria

    i want to know how to configure cluster on couchdb 2.2, how to add node?
    can i get some tutorial?

  4. Kelvin Bryant Avatar
    Kelvin Bryant

    when run ‘ sudo systemctl status couchdb.service ‘ I receive everything as shown in your example in my Unbuntu 18.04 environment. When I navigate to the url: http://127.0.0.1:5984/_utils/, I received page not found. I noticed that from my machine when I do ‘telnet 127.0.0.1 5984’ I am not connecting. Also how do you return to the powershell prompt after running ‘sudo systemctl status couchdb.service’?

  5. Kelvin Bryant Avatar
    Kelvin Bryant

    After setting up couchdb and running the status command, I am receiving the following:
    kelalfbry@BRYANTVM:~$ sudo systemctl status couchdb.service
    ● couchdb.service – Apache CouchDB
    Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: enabled)
    Active: active (running) since Wed 2019-11-13 19:00:00 UTC; 1s ago
    Main PID: 118780 (beam.smp)
    Tasks: 24 (limit: 9513)
    CGroup: /system.slice/couchdb.service
    ├─118780 /opt/couchdb/bin/../erts-8.3.5.4/bin/beam.smp -K true -A 16 -Bd — -root /opt/couchdb/bin/.. -progname couchdb — -home /opt/couchdb
    ├─118801 /opt/couchdb/bin/../erts-8.3.5.4/bin/epmd -daemon
    └─118820 erl_child_setup 1024

    Nov 13 19:00:00 BRYANTVM systemd[1]: Started Apache CouchDB.
    Nov 13 19:00:01 BRYANTVM couchdb[118780]: [os_mon] memory supervisor port (memsup): Erlang has closed
    Nov 13 19:00:01 BRYANTVM couchdb[118780]: [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
    l

Leave a Reply to alif satria Cancel 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.