CouchDB 2.1 on Raspberry Pi (Raspbian Stretch)

1 Comment

CouchDB 2.1 on R-PiFrom the Apache CouchDB docs:

CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents with your web browser, via HTTP. Query, combine, and transform your documents with JavaScript. CouchDB works well with modern web and mobile apps.

CouchDB also has Fauxton, a native web-based interface built into CouchDB. It provides an interface to the majority of the CouchDB functionality, including the ability to create, update, delete and view documents and configuration parameters.

I’ve already written a blog post for installing CouchDB 2.0 under Rasbian Jessie for Raspberry Pi.  I’m updating my instructions for CouchDB 2.1 and Raspbian Stretch (in addition to Jessie). I’m presenting this “how-to” in coolbook form — i.e. just type in the commands as presented and you should end up with a functional CouchDB install.  For more background and info, check out my previous blog post.


CouchDB 2.0 on Raspberry Pi


The Apache Software Foundation has released CouchDB version 2.0.  CouchDB 2.0, is a “distributed” version of CouchDB, a mature NoSQL, document-oriented data-store that is accessable via a RESTful JSON API. Developers can take advantage of CouchDB’s offline capability and reliable data sync for web, mobile and IoT apps at (any) scale.

[NOTE: September 2017 — CouchDB 2.1 and Raspbian Stretch have been released.  Check out updated instructions in this blog post]

Current Raspbian (November 2016) can “apt-get install” version 1.4 and I have previously written about getting CouchDB 1.6 running on the R-Pi.  I have now installed version 2.0.0 on an R-Pi 3 and am sharing the process.  It is pretty straightforward to get CouchDB 2.0 running on the R-Pi. It takes a combination of the R-Pi specific 1.6 install and the “generic linux” 2.0 install to get things running.


CouchDB 1.6 on Raspberry Pi


CouchDB_logoPer its website, Apache CouchDB™ is a database that uses JSON for documents, JavaScript for MapReduce indexes, and regular HTTP for its API.  One of its very cool and powerful features is that you can even serve web apps directly out of CouchDB.

CouchDB is available for Raspberry Pi via a simple, “apt-get install couchdb” BUT you’ll be installing version 1.2.  The latest stable version as of 1 September 2015 is 1.6.1.  While 1.6.1 is the latest, I found an excellent how-to for installing 1.6.0 at the blog, “Playing JEE on the Pi“.  The big difference between 1.6.0 and 1.6.1 is the fix of an admin password hash issue.  If you are using admin passwords, be aware that start-up under 1.6.0 could be an issue.  I have not yet had time to upgrade the install process for 1.6.1.

In any case, you can find very easy to follow install instructions in an article, “Installing CouchDB 1.6.0 on the Raspberry Pi” on the “Playing JEE on the Pi” blog.  Follow the instructions carefully and you’ll end up with:

pi@Pi-2 ~ $ which couchdb
pi@Pi-2 ~ $ couchdb -V
couchdb - Apache CouchDB 1.6.0

Note: if you have installed an older version of CouchDb using “apt-get” you should uninstall first!  You’ll see a few warnings with the new build and install but everything will install and function correctly.  Failure to uninstall a previous version will result in permission issues and incorrect start-up.