Install and Configure RockMongo - A Tool to Manage MongoDB

April 1, 2015 | By in LINUX HOWTO
| 1 Reply More

Hi everybody, today we'll learn about RockMongo and how we can setup it on our CentOS 6 or CentOS 7. RockMongo is an Open Source tool developed for MongoDB administration tool which is written in PHP 5. It is one of the best tool for MongoDB administration available currently. It provides a very good user-friendly way to create database, collections, documents, query collections, import and export data and insert and fetch documents using a web interface. It is a lot similar to PhpMyAdmin tool.

We'll need to make sure that we have the following prerequisites fulfilled to configure RockMongo.

  1. A web server running PHP
  2. PHP 5 or higher with session support
  3. the php_mongo extension for MongoDB
  4. A running MongoDB database system

So, here are the quick and simple steps by which we can easily install RockMongo on our CentOS 6 or 7 Operating System.

1. Installing a Web Server and Php 5

First of all, we'll need to install a web server supporting PHP. We'll install Apache Web Server in this tutorial for a web server and we'll install Php 5 out of the box. To install them we'll need to run the following command in a shell or a terminal.

# yum install httpd php-devel php

Installng httpd

2. Installing PHP Mongo Extension

Then, we'll install PHP Mongo Driver extension which is essential for MongoDB. We'll first need to install git so that we can pull the driver package out of github.

# yum install git

Installing Git

Now, to configure and install the mongo php driver, here are the steps to be followed.

# cd /tmp/
# git clone
# cd mongo-php-driver/
# phpize

Cloning RockMongo

# ./configure
# make all

configuring mono php driver

# make install

Installing mongo php driver

After installing Php Mongo Extenstion, we'll now download our RockMongo and install it on our machine.

3. Downloading RockMongo

Now, we'll download our latest RockMongo from github to /tmp/ folder in our CentOS box. To do so, we'll need to run the following command in a shell or terminal.

# cd /tmp/
# wget

After downloading it with wget, we'll want to extract it.

# unzip

Then, we'll want to move the folder to /var/www/html/ which is the default webroot of Apache Web Server so that the directory will be accessible to the internet.

# mv rockmongo-master/ /var/www/html/rockmongo

extracting rockmongo

4. Configuring Php

Now, we'll need to configure php.ini which is located inside /etc/ directory. We'll can open the file with our favorite text editor.

# nano /etc/php.ini

Now, we'll want to append the file with the below configuration.

Adding Mongo Extension to PHP

5. Restarting Apache Web Server

After all the above task is completed, we'll finally want to restart our Apache Web Server.

# systemctl restart httpd.service

Now, after done we'll wanna goto http://ip-adress/rockmongo/ or http://my-website/rockmongo/ according to the configuration using our favorite browser. Then, we'll want to login to the page with the credential required username and password as admin and admin respectively by default.

rockmongo web

Inorder to change the default username and password of the login of RockMongo can be changed by editing /var/www/html/rockmongo/config.php file with our favorite text editor

# nano /var/www/html/rockmongo/config.php

Now, we'll need to replace admin/admin with the desired username and password one wishes to change.

$MONGO["servers"][$i]["control_users"]["admin"] = "admin";

6. Configuring Firewall

If we have firewall enabled, we'll want to open port 80 for Apache Web Server so that RockMongo will be accessible.

On CentOS 6

# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

On CentOS 7

# firewall-cmd --zone=dmz --add-port=2888/tcp --permanent
# firewall-cmd --reload

Now, we'll want to restart our Apache Web Server as shown in above step 5.


Finally, we have successfully installed RockMongo in our CentOS 6.x/7.x machine. RockMongo is an awesome tool for MongoDB Administration having pretty cool user interface as like of Phpmyadmin. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy RockMongo :-)


Share This :

Free Linux Ebook to Download

Comments (1)

Trackback URL | Comments RSS Feed

  1. Siarhei says:

    Before executing `phpize` you need execute `git submodule update --init` because some libs (libmongoc, libbson) now are moved to standalone repos.

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.