Installing Ubuntu 12.04 Server and CouchDB 1.2.0

Install Ubuntu

Download an iso image of Ubuntu Server 12.04 from Ubuntu’s website and burn it to CD.

Choose the following options during the “Software Selection” phase of the installation (optional):

  • OpenSSH Server
  • Manual Package Selection (+ to add package, q to quit and install)
    • httpd > main > apache2.2-bin
    • httpd > main > libapache2-mod-php5
  • Mail Server
    • Internet Site

Update the repository information and the installed packages to the latest versions

sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot (in case the kernel is updated)

Installing CouchDB


sudo apt-get -y install build-essential autoconf automake libtool erlang libicu-dev libmozjs-dev libcurl4-openssl-dev

Installing CouchDB

tar -xvzf apache-couchdb-1.2.0.tar.gz
cd apache-couchdb-1.2.0
make && sudo make install

Add CouchDB user and group

sudo adduser --disabled-login --disabled-password --no-create-home couchdb
Full Name[]: CouchDB Admin
Just hit return for the other requested info

Check/set right owner for files and folders (alternatively, you might have it installed in /var instead of /usr/local/var)

sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo chown -R couchdb:couchdb /usr/local/etc/couchdb/

Link couchdb service script to /etc/init.d.

sudo ln -s /usr/local/etc/init.d/couchdb  /etc/init.d

Configure service to start when you enter/change levels

sudo update-rc.d couchdb defaults

Reboot to make sure everything works

sudo reboot

Use curl to verify couchdb is running

curl -X GET http://localhost:5984