DebianDebian BasedTutorials

How To Install Apache CouchDB on Debian 11

Install Apache CouchDB on Debian 11

In this tutorial, we will show you how to install Apache CouchDB on Debian 11. For those of you who didn’t know, Apache CouchDB is an open-source NoSQL database developed by the Apache Software Foundation. CouchDB uses multiple formats and protocols to store, transfer and process data. CouchDB uses JSON to store data, JavaScript as its query language, and HTTP as an API.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Apache CouchDB NoSQL database server on a Debian 11 (Bullseye).

Prerequisites

  • A server running one of the following operating systems: Debian 10 or Debian 11.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Apache CouchDB on Debian 11 Bullseye

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt upgrade
sudo apt install curl apt-transport-https gnupg nano lsb-release 

Step 2. Installing Apache CouchDB on Debian 11.

By default, CouchDB is not available on Debian 11 base repository. So, now run the following command below to add the Apache CouchDB repository to your Debian system:

echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ `lsb_release -cs` main" \
    | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null

Next, import the GPG key:

curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1

After the repository is enabled, now install the latest version of Apache CouchDB using the below command:

sudo apt update
sudo apt install couchdb

During your installation, you will be asked to configure CouchDB. In the first window, read the configurations and press ok to continue:

 ┌──────────────────────────┤ 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         
 │                                                                             
 │                                                                         
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘

Next, select the standalone option and continue:

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

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_______________________________________________________________ │ 
  │                                                                          │ 
  │                                                                      │ 
  │                                                                          │ 
  └──────────────────────────────────────────────────────────────────────────┘

You can verify your CouchDB installation by using the curl command on Debian 11:

curl http://127.0.0.1:5984/

Output:

{"couchdb":"Welcome","version":"3.2.3","git_sha":"d5b73187c","uuid":"7a20b1eadd8meilana7fb96jelitae","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

Step 4. Accessing Apache CouchDB NoSQL Web Interface.

Once successfully installed, open a web browser on your system and type the server’s IP in the address bar. You will get the default Apache CouchDB page:

http://Your-IP-address:5984/_utils/

Congratulations! You have successfully installed Apache CouchDB. Thanks for using this tutorial for installing the latest version of the Apache CouchDB NoSQL database on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official Apache website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button