Bitnami CouchDB Virtual Machine

Description

CouchDB is an open source NoSQL database that stores your data with JSON documents, which you can access via HTTP. It allows you to index, combine, and transform your documents with JavaScript.

First steps with the Bitnami CouchDB Stack

Welcome to your new Bitnami application! This guide includes some basic information you will need to get started with your application.

How to import a Bitnami Virtual Machine?

Check the following instructions to import a Bitnami Virtual Machine:

Importing a Bitnami Virtual Machine in VirtualBox
  • Select the "File -> Import Appliance" menu option and select the .ova file downloaded from the Bitnami website. Then click "Continue".
  • Once it is imported, click the "Start" button in the VirtualBox toolbar.

For a detailed walkthrough, check our Virtualbox tutorial.

Importing a Bitnami Virtual Machine in a VMware product
  • Select the "File -> Import" menu option and select the .ova file downloaded from the Bitnami website. Then click "Continue".
  • Once the import is complete, click "Finish" to start the virtual machine.

For a detailed walkthrough, check our VMware tutorial, which uses VMware Fusion as an example. To learn how to use our virtual machines with other VMware products, refer to the VMware Workstation documentation or the VMware vSphere documentation.

What credentials do I need?

You need two sets of credentials:

  • The application credentials, consisting of a username and password. These credentials allow you to log in to your new Bitnami application.

  • The server credentials, consisting of an SSH username and password. These credentials allow you to log in to your Virtual Machines server using an SSH client and execute commands on the server using the command line.

What is the administrator username set for me to log in to the application for the first time?

Username: admin

What is the administrator password?

Password: The administrator password to log in to your application is randomly generated during the first boot. Check the FAQ to learn how to retrieve it.

What SSH username should I use for secure shell access to my application?

SSH username: bitnami

What is my server IP address?

The IP address is displayed on screen at the end of the boot process, but you can check it at any time by running the following command:

  $ sudo ifconfig

Check server IP address

How do I get my SSH key or password?

You can obtain the SSH password from the virtual machine console when it starts up. Click here for more information.

How to access your application?

Once you have imported your Bitnami Virtual Machine, the IP address for your application is displayed on the virtual machine's login screen. Access the application via your browser by entering this IP address.

Check these instructions about how to remotely access the Bitnami application.

What are the default ports?

A port is an endpoint of communication in an operating system that identifies a specific process or a type of service. Bitnami stacks include several services or servers that require a port.

Remember that if you need to open some ports you can follow the instructions given in the FAQ to learn how to open the server ports for remote access.

Port 22 is the default port for SSH connections.

The CouchDB access port is 5984. This port is closed by default, you must open it to enable remote access.

How to start or stop the services?

Each Bitnami stack includes a control script that lets you easily stop, start and restart services. The script is located at /opt/bitnami/ctlscript.sh. Call it without any service name arguments to start all services:

$ sudo /opt/bitnami/ctlscript.sh start

Or use it to restart a single service, such as Apache only, by passing the service name as argument:

$ sudo /opt/bitnami/ctlscript.sh restart apache

Use this script to stop all services:

$ sudo /opt/bitnami/ctlscript.sh stop

Restart the services by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh restart

Obtain a list of available services and operations by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh

What is the default configuration of CouchDB?

The default access port for CouchDB's HTTP server is 5984. HTTPS is disabled and remote access is disabled by default.

How to connect to CouchDB from a different machine?

For security reasons, the CouchDB port in this solution cannot be accessed over a public IP address. To connect to CouchDB from a different machine, you must open port 5984 for remote access. Refer to the FAQ for more information on this.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Once the firewall rule is in place, perform these additional steps:

  • Stop your CouchDB server and edit the /opt/bitnami/couchdb/etc/local.ini file. Change the bind_address from 127.0.0.1 to 0.0.0.0:

      [chttpd]
      port = 5984
      bind_address = 0.0.0.0
      ...
    
      [httpd]
      bind_address = 0.0.0.0
      ...
    
  • Restart your server for the changes to take effect.

      $ sudo /opt/bitnami/ctlscript.sh restart couchdb
    

You should now be able to connect to the CouchDB server from a different machine using the server's public IP address and receive a welcome message. This is shown in the example command and output below:

$ curl http://SERVER-IP:5984/
{"couchdb":"Welcome","version":"2.1.1","features":["scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

How to change the CouchDB admin password?

You can modify the CouchDB admin password with these steps:

  • Stop your server.

     $ sudo /opt/bitnami/ctlscript.sh stop couchdb
    
  • Edit your /opt/bitnami/couchdb/etc/local.ini configuration file, editing the respective admin password to what you want, in the [admin] section. For example:

     admin = my_new_password
    
  • CouchDB will take care of hashing your password, so the only thing you need is to start your server again.

     $ sudo /opt/bitnami/ctlscript.sh restart couchdb
    

How to enable SSL (for HTTPS) on CouchDB?

You can enable SSL on CouchDB using these steps:

  • Stop CouchDB.

     $ sudo /opt/bitnami/ctlscript.sh stop couchdb
    
  • Edit your /opt/bitnami/couchdb/etc/local.ini file and edit the [daemons] section so that the line activating the httpsd daemon is uncommented.

     [daemons]
     httpsd =  {couch_httpd, start_link, [https]}
    
  • Within the same file, make sure your [ssl] section includes at least the following lines uncommented:

     [ssl]
     port = 6984
     cert_file = /opt/bitnami/couchdb/conf/server.crt
     key_file = /opt/bitnami/couchdb/conf/server.key
    

    The certificates Bitnami includes are self-signed so you might get a warning when trying to access your site. To avoid this warning, you should get new certificates signed by a Certificate Authority, and uncomment the following line:

     ;cacert_file = /full/path/to/cacertf
    
  • Open the CouchDB HTTPS port in the server firewall. For more information, refer to the FAQ.

NOTE: Remember to change the bind_address from 127.0.0.1 to 0.0.0.0 if you want to connect to CouchDB from a different machine. Refer to these instructions for more information.
  • Finally, start your CouchDB server again and you will be able to access CouchDB over SSL at the selected port eg. at https://SERVER-IP:6984/.

     $ sudo /opt/bitnami/ctlscript.sh restart couchdb
    

How to connect to Fauxton, the CouchDB management panel?

By default, CouchDB is configured to listen on the local interface only, so an SSH tunnel is needed to access it. Use port 5984 (the default CouchDB port) for both ends of your SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Once your SSH tunnel is running, you can connect to Fauxton, CouchDB's management panel, by browsing to http://127.0.0.1:LOCAL_PORT/_utils/. To log in, use the username and password obtained from the server dashboard. Remember to replace LOCAL-PORT with the local port number specified during the SSH tunnel creation.

How to debug CouchDB errors?

To debug CouchDB's errors, use the log files at /opt/bitnami/couchdb/var/log/couchdb/.

virtualMachine