How to install CouchDB on Ubuntu

To install CouchDB on Ubuntu first we need to add the proper repositories to our system by running the following command:

$ echo "deb https://apache.bintray.com/couchdb-deb {distribution} main" | sudo tee -a /etc/apt/sources.list

and replace {distribution} with the appropriate choice for your OS version:

  • Ubuntu 14.04: trusty
  • Ubuntu 16.04: xenial

After this we need to install the repository key:

$ curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \
| sudo apt-key add -

and finally we update the repository and install the needed packages with:

$ sudo apt-get update && sudo apt-get install couchdb

In case that during the installation process we get prompted with a question about the type of installation we specify single node and configure user and password settings to access the server. Otherwise we should follow the instructions on First Time Setup.

If we get some type of error during the installation process we need to make sure that this dependencies are installed:

  • Erlang OTP (>=R16B03, =<19.x)
  • ICU
  • OpenSSL
  • Mozilla SpiderMonkey (1.8.5)
  • GNU Make
  • GNU Compiler Collection
  • libcurl
  • help2man
  • Python (>=2.7) for docs
  • Python Sphinx (>=1.1.3)

If you use other operating system check the Intallation Page on CouchDB official documentation and also there you can see why the above dependencies are needed to install CouchDB.

Testing newly installed CouchDB

Relax! CouchDB is installed and running.

To check that CouchDB is running properly on our local machine or server use this command on your terminal:

curl http://127.0.0.1:5984/

This issues a GET request to your newly installed CouchDB instance.

The reply should look something like:

{
"couchdb": "Welcome",
"vendor": {
"name": "The Apache Software Foundation"
},
"version": "2.0.0"
}
Ubuntu 14.04 - $ sudo /etc/init.d/couchdb restart
Ubuntu 16.04 - service couchdb restart or couchdb restart

Not all that spectacular. CouchDB is saying “hello” with the running version number. In case you don’t get a response like this try restarting the service:

  • Ubuntu 14.04: $ sudo /etc/init.d/couchdb restart
  • Ubuntu 16.04: $ service couchdb restart or $ couchdb restart

Next we can access Fauxton[4] (visual web interface) going to the next url on our web browser:

http://127.0.0.1:5984/_utils/

Conclusion

As we can see the installation of CouchDB is pretty straight forward and simple. Stay tuned with our channel and articles because in the future we will explain some security and advanced configuration of CouchDB.

Author: Eng. Alberto Aragón Alvarez

Like what you read? Give Altura Soluciones a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.