CouchDB: Create Database
In CouchDB, we can create a database either in Fauxton, a built-in web-based interface for admin, or from the terminal using the cURL utility tool.
What is cURL?
cURL stands for "Client URL", and is a command line utility for transfering data using URL syntax over common Internet protocols like HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DAP, DICT, TELNET, FILE, IMAP, POP3, SMTP and RTSP. It was originally authored by Daniel Stenberg, a Swedish Developer, and was first released in 1997. It is available on a variety of operating systems besides the usual Linux, macOS and Windows.
Besides Fauxton, we will also be using cURL throughout the tutorials to interact with CouchDB via the HTTP protocol.
Create Database in Fauxton
Click on the " Create Database ... " button located on the top bar of your Fauxton's interface.

A menu with input opens up prompting to enter a database name.

We enter a name, say books
, and click the "Create" button. A new database is created. Note that the database has zero documents so far.

Create Database Using cURL
The above database can also be created using the curl
utility tool along with the -X
command line option and PUT
method over the HTTP protocol with the following command:
sudo curl -X PUT http://127.0.0.1:5984/books
On successful creation, CouchDB replies:
{"ok":true}
