Skip to end of metadata
Go to start of metadata

Become a contributor

You need to be added as a contributor to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

Building from Source on Debian-based systems

Note the future build process for CouchDB 2.0+ is radically different, skip to the 2.0+ section below and remember YMMV.

While it's possible to build all the dependencies from source also, you'll be up and running a lot faster if you use the recommended ones below, as they are what most developers use and test CouchDB with. If these instructions don't work for you, please let us know the details via comment below, on the user@ mailing list, or a JIRA ticket if there's a demonstrable bug. Each version and release of Debian may require tweaks and changes, so we rely on your feedback!

Debian < 7.0

 

  • Cloudant kindly provides a robust build of Mozilla Spidermonkey for Debian < 7.0, in more recent releases, you can use the Debian distributed version without issue. It should be 1.8.5, no more & no less.
  • Erlang Solutions kindly provide a very solid and trusted Erlang/OTP package; the versions shipped in most Debian releases are not suitable for various reasons - you have been warned!

Add Cloudant and Erlang Solutions repositories:

sudo apt-get install -y lsb-release
echo "deb http://binaries.erlang-solutions.com/debian `lsb_release -cs` contrib" \
  | sudo tee /etc/apt/sources.list.d/erlang-solutions.list
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc \
  | sudo apt-key add -
echo "deb http://packages.cloudant.com/debian `lsb_release -cs` main" \
  | sudo tee /etc/apt/sources.list.d/cloudant.list
wget http://packages.cloudant.com/KEYS -O - | sudo apt-key add -
sudo apt-get update -y
sudo apt-get install -y libmozjs185-cloudant libmozjs185-cloudant-dev

Debian >= 7.0

 

  • The current Debian 7.x series has a compatible SpiderMonkey version. Note that it should be 1.8.5, no more & no less.
  • The Erlang dependencies vary, you are best to check directly the CouchDB Release Notes to see what the CouchDB project recommends. If what's available in Debian is not appropriate, then  use the
    Erlang Solutions one, who very kindly provide a very solid and trusted Erlang/OTP package.

Add Erlang Solutions repository:

sudo apt-get install -y lsb-release
echo "deb http://binaries.erlang-solutions.com/debian `lsb_release -cs` contrib" \
  | sudo tee /etc/apt/sources.list.d/erlang-solutions.list
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc \
  | sudo apt-key add -
sudo apt-get update -y
sudo apt-get install -y libmozjs185 libmozjs185-dev

All Debian versions: 

 

From this point on, instructions are again merged.

Install Erlang/OTP and C compilers:

sudo apt-get install -y erlang-nox erlang-dev
sudo apt-get install -y build-essential

 Dependencies for libmozjs / spidermonkey and friends

sudo apt-get install -y libnspr4 libnspr4-0d libnspr4-dev libcurl4-openssl-dev curl libicu-dev

Set up a couchdb daemon account


sudo useradd -d /var/lib/couchdb couchdb
sudo mkdir -p /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb /var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb
sudo chmod -R g+rw /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb

Install CouchDB up to 1.6.x

 

e.g. http://www.apache.org/dyn/closer.cgi?path=/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz

tar xzf apache-couchdb-*.tar.gz
cd apache-couchdb-*
./configure --prefix=/usr/local --with-js-lib=/usr/lib --with-js-include=/usr/include/mozjs --enable-init
make && sudo make install

Start CouchDB

sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
sudo /etc/init.d/couchdb start
sudo update-rc.d couchdb defaults
# check it runs
curl http://127.0.0.1:5984/

Install CouchDB 2.0+

 

These are brief notes, please refer to the developer mailing list if you get stuck. In particular note that Erlang 17.1 is recommended. 17.3 has problems dealing with some SSL certificates, best avoided for the moment.

echo 'deb http://httpredir.debian.org/debian/ wheezy-backports main' > /etc/apt/sources.list.d/wheezy-backports.list

# install npm
# https://github.com/nodesource/distributions#deb
curl -sL https://deb.nodesource.com/setup | bash
apt-get install -y nodejs

# usual icu,spidermonkey, curl dependencies are all suitable
apt-get install -y build-essential libicu-dev libmozjs185-dev \
    libcurl4-openssl-dev pkg-config git

# we need a newer erlang, OTP 17.1 is good, but not 17.3
apt-get install -y -t wheezy-backports erlang-base-hipe erlang-dev \
    erlang-manpages erlang-dialyzer erlang-eunit erlang-nox

# and the latest rebar built from source
git clone https://github.com/rebar/rebar
(cd rebar ; make && sudo mv rebar /usr/local/bin/)

git clone https://github.com/apache/couchdb.git 
cd couchdb
./configure && make 
dev/run --admin=foo:bar 
# brings up three nodes on ports 15984, 25984, 35984 
  • No labels