CouchDB

Discover our Public Cloud offer

Shared Hosting for Everyone, imagined by developers, for developers.

Discovering the Public Cloud

CouchDB is a document-oriented noSQL database program.

In our example, we use the SSH access and consider the following information:

  • Account name: foo
  • CouchDB directory: $HOME/couchdb/

[foo] must be replaced by the name of your account.

Installation

Downloading and Compiling

foo@ssh:~$ mkdir couchdb
foo@ssh:~$ cd couchdb
foo@ssh:~/couchdb$ wget -O- https://dlcdn.apache.org/couchdb/source/3.4.1/apache-couchdb-3.4.1.tar.gz | tar -xz --strip-components=1
foo@ssh:~/couchdb$ ./configure --spidermonkey-version 78
foo@ssh:~/couchdb$ make release

Choose the tar.gz package of the latest version available from the official CouchDB site.

Configuring

Create a local.ini file in the $HOME/couchdb directory with the following directives:

[admins]
admin = mysuperpassword

[couchdb]
single_node = true

[chttpd]
bind_address = ::
port = 5984

Replace mysuperpassword with the password of your choice.

Public Cloud users will need to point the service to a port between 8300 and 8499 and modify this value in the configuration file.

Service launch

Create a service with following details:

  • Command: ./bin/couchdb -couch_ini /home/[foo]/couchdb/local.ini
  • Working directory: /home/[foo]/couchdb/rel/couchdb

The address to connect to the CouchDB instance will be services-[foo].alwaysdata.net:[port]. For example, to list the databases:

$ curl -X GET http://admin:mysuperpassword@services-[foo].alwaysdata.net:[port]/_all_dbs

Replace [port] with the port indicated in the local.ini file.

Firewall rule creation

Private Cloud users will need to open the port by creating a firewall rule if they want to access it from the external network:

TitleValue
ProtocolUDP/TCP
TypeACCEPT
DirectionInput
Hosts<specify nothing>
Ports5984
IP versionIPv4/IPv6