{"id":4230,"date":"2021-02-10T12:05:08","date_gmt":"2021-02-10T12:05:08","guid":{"rendered":"https:\/\/linuxways.net\/?p=4230"},"modified":"2021-02-10T12:05:11","modified_gmt":"2021-02-10T12:05:11","slug":"install-couchdb-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/install-couchdb-on-ubuntu-20-04\/","title":{"rendered":"Install CouchDB on Ubuntu 20.04"},"content":{"rendered":"<p>CouchDB is a popular NoSQL database developed and maintained by Apache Foundation since 2005. It is an open-source database written in Erlang language that provides a RESTful API that users can use to create and modify database objects. CouchDB provides a document-oriented architecture and presents data as key-value pairs.<\/p>\n<p>Now, let us install CouchDB on Ubuntu 20.04 LTS.<\/p>\n<h2><strong>Step 1: Install prerequisite packages<\/strong><\/h2>\n<p>The first step involves installing the prerequisite packages that will be required later in the installation. To run the following command:<\/p>\n<pre><strong>$ sudo apt install curl<\/strong><\/pre>\n<p><strong> <img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"334\" class=\"wp-image-4231\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-114.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-114.png 741w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-114-300x135.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/strong><\/p>\n<p>Next, Install the GPG key for encryption and signing of data.<\/p>\n<pre><strong>$ sudo apt install gnupg ca-certificates -y<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"402\" class=\"wp-image-4232\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-115.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-115.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-115-300x163.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/strong><\/p>\n<h2><strong>Step 2: Enable CouchDB repository<\/strong><\/h2>\n<p>Before you enable the CouchDB repository, be sure to install the repository key as follows:<\/p>\n<pre><strong>$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"261\" class=\"wp-image-4233\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-116.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-116.png 740w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-116-300x106.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/strong><\/p>\n<p>Then add CouchDB repository to the sources list file as follows:<\/p>\n<pre><strong>$ echo \"deb https:\/\/apache.bintray.com\/couchdb-deb focal main\" &gt;&gt; \/etc\/apt\/sources.list<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"167\" class=\"wp-image-4234\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-117.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-117.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-117-300x68.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/strong><\/p>\n<p>Once you have added the CouchDB repository, update the package lists to sync the repository.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"245\" class=\"wp-image-4235\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-118.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-118.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-118-300x100.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/strong><\/p>\n<h2><strong>Step 3: Install couchDB<\/strong><\/h2>\n<p>You can now proceed to install CouchDB as follows as a sudo user.<\/p>\n<pre><strong>$ sudo apt install couchdb<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"310\" class=\"wp-image-4236\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-119.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-119.png 741w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-119-300x126.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/strong><\/p>\n<p>The installation requires you to select the CouchDB configuration mode. There are two types of configuration:<\/p>\n<ol>\n<li><strong>Standalone mode<\/strong>: This is used when dealing with a single server instance.<\/li>\n<li><strong>Clustered<\/strong>: As the name suggests, this is used when you have multiple servers that are interconnected.<\/li>\n<\/ol>\n<p>Since this guide demonstrates the installation on a single server, we will go with the \u2018<strong>Standalone<\/strong>\u2019 option.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"426\" class=\"wp-image-4237\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-120.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-120.png 740w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-120-300x173.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/strong><\/p>\n<p>Next, be sure to specify the bind-address. By default, this is set to the localhost address which is just okay for a standalone server. Just press ENTER.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"458\" class=\"wp-image-4238\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-121.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-121.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-121-300x186.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/strong><\/p>\n<p>Next, set a strong password for the Admin user.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"477\" class=\"wp-image-4239\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-122.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-122.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-122-300x194.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/strong><\/p>\n<p>Confirm the password and hit ENTER.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"444\" class=\"wp-image-4240\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-123.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-123.png 740w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-123-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-123-501x300.png 501w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/strong><\/p>\n<p>Afterward, the installation will continue running and complete.<\/p>\n<h2><strong>Step 4: Test couchDB<\/strong><\/h2>\n<p>To verify that the installation went as expected, use the curl command to retrieve basic information about CouchDB in JSON format;<\/p>\n<pre><strong>$ curl http:\/\/127.0.0.1:5984<\/strong><\/pre>\n<p>You will get a set of output as indicated below<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"173\" class=\"wp-image-4241\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-124.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-124.png 899w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-124-300x58.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-124-768x148.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/strong><\/p>\n<p>CouchDB listens to port 5984 and you can confirm this by initiating the command:<\/p>\n<pre><strong>$ sudo netstat -pnltu | grep 5984<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"188\" class=\"wp-image-4242\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-125.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-125.png 901w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-125-300x63.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-125-768x160.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/strong><\/p>\n<p>When CouchDB is installed, two databases are created by default. These are replicator and users databases. To verify this, browse the URL below:<\/p>\n<pre><a href=\"http:\/\/127.0.0.1:5984\/_utils\"><strong>http:\/\/127.0.0.1:5984\/_utils<\/strong><\/a><\/pre>\n<p>Provide the login details with \u2018<strong>admin<\/strong>\u2019 as the username and the password that you provided during the installation process in Step 3.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"431\" class=\"wp-image-4243\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-126.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-126.png 825w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-126-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-126-768x401.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/strong><\/p>\n<p>This ushers you to the couchDB database below.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1295\" height=\"431\" class=\"wp-image-4244\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-127.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-127.png 1295w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-127-300x100.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-127-1024x341.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-127-768x256.png 768w\" sizes=\"auto, (max-width: 1295px) 100vw, 1295px\" \/><\/strong><\/p>\n<p>Those two tests confirm that CouchDB is successfully installed. Bravo!<\/p>\n<p>Hopefully, you are now in a comfortable position to install CouchDB on your system.<\/p>","protected":false},"excerpt":{"rendered":"<p>CouchDB is a popular NoSQL database developed and maintained by Apache Foundation since 2005. It is an open-source database written in Erlang language that provides a RESTful API&hellip;<\/p>","protected":false},"author":32,"featured_media":4245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[100],"class_list":["post-4230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/4230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=4230"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/4230\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/4245"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=4230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=4230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=4230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}