Apache CouchDB is an open-source database that uses JSON documents to store data. It is designed to be simple, scalable, and distributed, and it supports a wide range of query and indexing options. In this article, we will show you how to install Apache CouchDB on Rocky Linux 8.
- Before you can install Apache CouchDB, you need to make sure that your Rocky Linux 8 system is up to date. Run the following command to update the package index:
sudo dnf update
- Next, you need to add the Apache CouchDB package repository to your system. This will allow you to install the latest version of Apache CouchDB using the
dnf
package manager. To add the repository, run the following command:
sudo dnf install <https://download.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os/Packages/c/couchdb-release-1.1.2-1.fc32.noarch.rpm>
- Once the repository is added, you can install Apache CouchDB by running the following command:
sudo dnf install couchdb
- After the installation is complete, you can start the Apache CouchDB service and enable it to start at boot time by running the following commands:
sudo systemctl start couchdb
sudo systemctl enable couchdb
- With the Apache CouchDB service running, you can access the CouchDB web interface by opening a web browser and navigating to
http://localhost:5984/_utils/
. This will bring up the CouchDB web interface, where you can manage your databases, users, and other settings. - To create a new database in the CouchDB web interface, click the “Create Database” button and enter a name for the database. This will create the database and take you to the database management page, where you can add, edit, and delete documents in the database.
- To create a new user in the CouchDB web interface, click the “Setup” tab and then click the “Add Admin User” button. This will bring up a form where you can enter the details for the new user, such as the username, password and roles. Once you have entered the details, click the “Create” button to create the user.
- To change the default database directory in the CouchDB web interface, click the “Setup” tab and then click the “Configuration” tab. This will bring up a form where you can edit the configuration settings for Apache CouchDB. To change the default database directory, find the
database_dir
setting and enter the new directory. Once you have made the changes, click the “Save” button to save the configuration. - To change the bind address for the Apache CouchDB HTTP server in the CouchDB web interface, click the “Setup” tab and then click the “Configuration” tab. This will bring up a form where you can edit the configuration settings for Apache CouchDB. To change the bind address, find the
bind_address
setting and enter the new address. Once you have made the changes, click the “Save” button to save the configuration. - To create a new database using the
couchdb
command-line tool, you can use thecreate
command. For example, to create a database named “mydb”, you can run the following command:
couchdb create mydb
This will create a new database named “mydb” in Apache CouchDB.
- To add a new document to a database using the
couchdb
command-line tool, you can use theadd
command. For example, to add a document with the JSON content{"name": "John Doe"}
to the “mydb” database, you can run the following command:
couchdb add mydb '{"name": "John Doe"}'
This will add a new document to the “mydb” database with the specified JSON content.
- To create a new user using the
couchdb
command-line tool, you can use theuser-add
command. For example, to create a user named “user1” with the password “password1” and the roles “admin” and “reader”, you can run the following command:
couchdb user-add user1 password1 admin reader
This will create a new user named “user1” with the specified password and roles in Apache CouchDB.
These are just a few examples of how to configure Apache CouchDB using the web interface and the couchdb
command-line tool. For more information and a complete list of options, you can refer to the Apache CouchDB documentation.
Congratulations! You have successfully installed Apache CouchDB on Rocky Linux 8 and created a new database and user. You can now start using Apache CouchDB to store and manage your data.