RockMongo is a popular web-based interface for managing MongoDB databases. It allows you to easily view and manipulate the data stored in your databases, as well as run commands and manage users. In this article, we’ll show you how to install and configure RockMongo on Rocky Linux 8.

Before we begin, you’ll need to make sure that you have a working installation of Rocky Linux 8. You’ll also need to have the epel-release package installed, as we’ll be using some packages from the Extra Packages for Enterprise Linux (EPEL) repository.

Installing RockMongo

To install RockMongo, we’ll first need to add the EPEL repository to our system. We can do this by running the following command:

sudo dnf install epel-release

Once the EPEL repository is added, we can use the dnf package manager to install RockMongo and its dependencies:

sudo dnf install rockmongo

This will install RockMongo and all of the required libraries and dependencies.

Configuring RockMongo

Once RockMongo is installed, we’ll need to configure it to connect to our MongoDB server. By default, RockMongo is configured to connect to a local MongoDB server listening on the default port (27017). If you want to connect to a remote MongoDB server, or if your MongoDB server is listening on a non-default port, you’ll need to edit the RockMongo configuration file.

The RockMongo configuration file is located at /etc/rockmongo.ini. To edit this file, you’ll need to use a text editor. For example, you can use nano by running the following command:

sudo nano /etc/rockmongo.ini

In the RockMongo configuration file, you’ll need to edit the host and port settings under the [MongoDB] section. For example, if you want to connect to a MongoDB server running on the same machine as RockMongo, but listening on port 27018, you would change the host and port settings to the following:

[MongoDB]
host = localhost
port = 27018

Save the configuration file and exit the text editor.

Starting RockMongo

Once RockMongo is installed and configured, we can start the RockMongo service by running the following command:

sudo systemctl start rockmongo

This will start the RockMongo service, and it will automatically start every time the system boots.

To access the RockMongo web interface, open a web browser and navigate to http://localhost/rockmongo. This will open the RockMongo login page, where you can enter the username and password for your MongoDB server.

Congratulations, you have successfully installed and configured RockMongo on Rocky Linux 8! You can now use the RockMongo web interface to easily manage your MongoDB databases.