// Tutorial //

How To Install CouchDB and Futon on Ubuntu 12.04

Published on December 17, 2012
Default avatar
By Etel Sverdlov
Developer and author at DigitalOcean.
How To Install CouchDB and Futon on Ubuntu 12.04

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.

About CouchDB

CouchDB, like Redis, Cassandra, and MongoDB, is a “NoSQL” database. Similar to other databases of its kind, CouchDB stores its information in a non-relational database, keeping its data in separate JSON documents. The advantage of this approach is that no particular schema is required for the inputted information, making the data contained within the documents more similar to their actual real world counterparts.

The couchdb database also has a web interface, called Futon.

Step One—Install CouchDB

You can install couchdb on your droplet using apt-get install. Prior to beginning the installation however, we would do well to update our system:

sudo apt-get update

Once the update completes, you can install CouchDB on your server:

sudo apt-get install couchdb

Couchdb by default runs on localhost, and you can retrieve the basic data by running curl from the command line:

 curl localhost:5984

(If you don't have curl installed, you can download it through sudo apt-get install curl)

You should get the following results:

 {"couchdb":"Welcome","version":"1.0.1"}

Creating a new database can be done with the command PUT:

curl -X PUT localhost:5984/new_database

The results should look like this:

{"ok":true}

Step Two—Access Futon

Couchdb also offers a convenient visual representation of the database called Futon. In order securely connect to it, without making it publicly available, you can create an SSH tunnel from your local port 5984 to the remote server's port 5984.

You can use the following command, run from your local computer, to set up the tunnel:

ssh -L5984:127.0.0.1:5984 [user]@[your_ip_address]

While the connection is open, accessing the right port for localhost in your brower will actually connect to you to the server and display the helpful Futon Page:

 localhost:5984/_utils
5984

By default, all couchdb users who reach futon are admins. This is announced in the bottom left corner:

admin party

You can change this by clicking on the little fix this link and creating your new admins.

By Etel Sverdlov

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

Sign up
About the authors
Default avatar
Developer and author at DigitalOcean.

Still looking for an answer?

Was this helpful?

Hello, I have installed Couhdb successfully, when I add a database, it shows ok:true. However, when i try to access FUTON, I get this error. adminuser@adminuser-VirtualBox:~$ localhost:5984/_utils -bash: localhost:5984/_utils: No such file or directory

help much appreciated.

thanks for the tutorial!

it will be nice if you add that: if user want to install latest stable version of couchdb than he needs to add ppa repository add-apt-repository ppa:couchdb/stable -y or https://launchpad.net/~couchdb/+archive/ubuntu/stable

@agamennon

Did you set the bind_address in /etc/couchdb/local.ini or /etc/couchdb/default.ini?

If you set it in default.ini, it is very possible that the value in local.ini is overriding it.

If that’s not the issue, could you post the contents of /etc/couchdb/local.ini?

i have a domain name, i want to access my couchdb using http://mydomain:5984 (i have set the bind_address to 0.0.0.0 but i cant access my couchdb, how do i do it?

I’ve installed CouchDB 1.5.0 on Ubuntu 12.04 from PPA successfully. Just follow this https://launchpad.net/~couchdb/+archive/stable.

Nice thanks

Just installed CouchDB with the instructions shown, it shows I’m running version 1.2.0. Make sure you run $ sudo apt-get update

The current couchdb in the repo is a bit outdated, latest version is 1.2.1