Use Futon to Manage CouchDB

Leave your reply

Introduction

Learn how to use Futon, the built-in web administration tool for CouchDB. Although you can manage CouchDB from the command line through its intuitive HTTP API, most people find that Futon is a much faster and easier way to interact with CouchDB. Futon is an easy, intuitive interface for creating and managing CouchDB databases and documents. Learn how to access and use Futon to manage CouchDB on your Servidor Cloud.

Requirements

  • A Servidor Cloud with Ubuntu 16.04
  • CouchDB installed and running

For step-by-step instructions for installing CouchDB, see our article Install and Use CouchDB on Ubuntu 16.04.

Firewall Access

If you have a firewall, you will need to allow access to port 5984.

For more information about using a firewall on a Servidor Cloud, consult our documentation on the topic.

Access Futon From the Internet

For security reasons, Futon is configured by default to only accept connections from the Localhost IP address (127.0.0.1). In order to use Futon in a browser, you will need to bind Futon to the server's public IP address.

To ensure you get full access to your Futon installation, please access Futon by following the step-by-step instruction in the article 4 Steps to Improve Your CouchDB Security.

Open the CouchDB configuration file for editing:

sudo nano /etc/couchdb/default.ini

Find the section which reads:

[httpd]
port = 5984
bind_address = 127.0.0.1

Save and exit the file. Then restart CouchDB for the changes to take effect:

Change the bind_address to your server's own IP address, for example:

[httpd]
port = 5984
bind_address = 192.168.0.1
sudo systemctl restart couchdb

You can now access Futon in a browser by going to http://192.168.0.1:5984/_utils/, where the IP address is replaced with your own. You will see the default Futon welcome page.

Use Futon

Create a Database

To create a database in Futon, go to the Overview page, then click Create Database...

Futon Web Interface

Enter the database name, then click Create.

Futon Web Interface

The database will be created, and you will be taken to the database's main page.

Create a Document

From the database's main page, click New Document to create a new database record (document).

Futon Web Interface

The document will be created with a default _id key/value pair. Leave this unchanged, as it is the document's unique identifier.

Click Add Field to add a new field.

Futon Web Interface

Enter the field (key) name, then click the green check mark to save it.

Futon Web Interface

Double-click null in the Value field to edit it.

Futon Web Interface

Enter the value, then click the green check mark to save it.

Futon Web Interface

Continue to add fields as needed for this document. When you have finished, click Save Document to save the record.

Futon Web Interface