CouchDB on an Ubuntu Development VM

Posted Wednesday 29th July, 2009

I’ve recently set-up CouchDB on the Ubuntu 8.10 (Intrepid Ibex) virtual machine I use for development. This was a relatively pain-free experience and I thought I’d outline what I did here for the benefit of others (and my future self).

Firstly, I decided to install using the aptitude package, rather than from source. If you’re interested in building the most recent version, I’d recommend taking a look at Isofarro’s handy “Installing CouchDB on JeOS 8.04” post.

To begin, install the package:

$ sudo apt-get install couchdb

Once the package has downloaded and installed, you should check the status to see if it’s running correctly:

$ sudo /etc/init.d/couchdb status

If you see the following output, then CouchDB is running successfully:

Apache CouchDB is running as process 32651. Time to relax.

If you don’t see that output, try starting CouchDB manually. I needed to do this:

$ sudo /etc/init.d/couchdb start

And then check the status again:

$ sudo /etc/init.d/couchdb status
Apache CouchDB is running as process 32651. Time to relax.

If you’re still not getting the correct status, you’ll need to refer to the CouchDB documentation.

Next, you should check that you can access CouchDB over HTTP on the default port of 5984. To do that, I used curl:

$ curl http://localhost:5984/

Which should return the following response:

{"couchdb":"Welcome","version":"0.8.0-incubating"}

The final step, to make sure you can access CouchDB externally to your dev VM, is to make sure the CouchDB configuration isn’t bound to the loopback address (127.0.0.1) – which it is by default. To do that, you’ll need to edit the couch.ini file:

$ sudo vim /etc/couchdb/couch.ini

And comment out the following line:

BindAddress=127.0.0.1

You can also change the port that CouchDB is running on in this configuration file if you so desire.

Finally, you’ll need to restart CouchDB:

$ sudo /etc/init.d/couchdb stop
$ sudo /etc/init.d/couchdb start

Now you should be able to log into Futon, the browser-based CouchDB admin system, on the following address:

http://mydevbox:5984/_utils/

Huzzah!

Included in: Apache, CouchDB, Development, HTTP, Linux, REST, Server, Tutorials, UNIX, Virtualisation

Categories:

  1. Accessibility
  2. Ajax
  3. Apache
  4. API
  5. Architecture
  6. Books
  7. Browsers
  8. CMS
  9. CouchDB
  10. CSS
  11. Design
  12. Development
  13. Django
  14. Email
  15. Events
  16. Gaming
  17. Grammar
  18. Hardware
  19. HTML
  20. HTTP
  21. Humour
  22. Idea
  23. Information Architecture
  24. JavaScript
  25. jQuery
  26. Life
  27. Linux
  28. Literature
  29. Mac OS X
  30. Meme
  31. Microformats
  32. Monday
  33. MySQL
  34. Networking
  35. News
  36. Personal
  37. Photoshop
  38. PHP
  39. Python
  40. Reference
  41. REST
  42. Science
  43. SEO
  44. Server
  45. Site
  46. Sitepimp
  47. Social
  48. Spelling
  49. Syndication
  50. Testing
  51. The Future
  52. Thoughts
  53. Tools
  54. Tutorials
  55. Typography
  56. UI
  57. UNIX
  58. Virtualisation
  59. Web
  60. Web Standards
  61. Widgets
  62. Wii
  63. Writing
  64. Xbox
  65. XHTML