Tutorials  /  Databases

Install RockMongo on CentOS 7 for MongoDB Management

Ccentron Redaktion · June 2025 ·5 min read ·Databases, Tutorial

RockMongo is a browser-accessible administration tool for MongoDB, functioning similarly to phpMyAdmin for MySQL. This guide walks you through how to install and operate RockMongo on a CentOS 7 x64 system.

Requirements Before You Begin

To follow along with this guide, ensure that you have the following in place:

  • An up-to-date CentOS 7 x64 instance
  • A user account with sudo privileges
DB

Matching infrastructure at centron

Databases need care in production: centron can take over updates, backups and monitoring – from a single instance to a full cluster. Explore managed clusters →

Step 1: Install Apache Web Server

Because RockMongo operates via the web, a functioning web server is essential. In this tutorial, we will install and configure Apache:

Console
sudo yum install httpd
sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 2: Configure the Firewall

To allow browser access to RockMongo, HTTP traffic must be permitted through the firewall. Use the commands below to adjust your firewall settings accordingly:

Console
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Once complete, open your browser and visit http://[YourServerIP] to confirm that Apache is running properly.

Step 3: Install PHP 5 and Required Extensions

Since RockMongo relies on PHP 5, you need to install it along with a few essential extensions to ensure proper functionality:

Console
sudo yum install php php-devel php-pear php-pecl-mongo
sudo yum install gcc openssl.x86_64 openssl-devel.x86_64
sudo pecl install mongodb
echo 'extension=mongodb.so' | sudo tee -a /etc/php.ini

Step 4: Install MongoDB

To proceed, follow the official guide to set up MongoDB on your CentOS system.

Step 5: MongoDB Configuration Steps

Some fine-tuning is necessary before MongoDB is ready for use:

a) Deactivate Transparent Huge Pages

To do this, create a startup script:

Console
sudo vi /etc/init.d/disable-transparent-hugepages

Paste the following script content into the file:

Code
#!/bin/sh
### BEGIN INIT INFO
# Provides:          disable-transparent-hugepages
# Required-Start:    $local_fs
# Required-Stop:
# X-Start-Before:    mongod mongodb-mms-automation-agent
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Disable Linux transparent huge pages
# Description:       Disable Linux transparent huge pages, to improve
#                    database performance.
### END INIT INFO

case $1 in
  start)
	if [ -d /sys/kernel/mm/transparent_hugepage ]; then
	  thp_path=/sys/kernel/mm/transparent_hugepage
	elif [ -d /sys/kernel/mm/redhat_transparent_hugepage ]; then
	  thp_path=/sys/kernel/mm/redhat_transparent_hugepage
	else
	  return 0
	fi

	echo 'never' > $/enabled
	echo 'never' > $/defrag

	unset thp_path
	;;
esac

Save and exit the editor:

Code
:wq!

Make the script executable and configure it to launch at startup:

Console
sudo chmod 755 /etc/init.d/disable-transparent-hugepages
sudo chkconfig --add disable-transparent-hugepages

Now modify the tuned configuration:

Console
sudo mkdir /etc/tuned/no-thp
sudo vi /etc/tuned/no-thp/tuned.conf

Insert the following content into the configuration file:

Code
[main]
include=virtual-guest

[vm]
transparent_hugepages=never

Save and exit:

Code
:wq!

Activate the new tuned profile:

Console
sudo tuned-adm profile no-thp

b) Set ulimit Parameters

Edit the system limits configuration:

Console
sudo vi /etc/security/limits.conf

Add the following four lines at the bottom of the file:

Code
mongod soft nofile 64000
mongod hard nofile 64000
mongod soft nproc 32000
mongod hard nproc 32000

Save and close the file:

Code
:wq!

Finally, reboot the server to apply all changes:

Console
sudo shutdown -r now

Step 6: Install RockMongo

To begin installing RockMongo, download the most recent stable version directly from GitHub using the following commands:

Console
cd ~
wget https://github.com/iwind/rockmongo/archive/1.1.7.tar.gz
tar zxvf 1.1.7.tar.gz

Next, for security reasons, it is important to change the default RockMongo admin credentials. Open the configuration file using a text editor:

Code
vi rockmongo-1.1.7/config.php

Locate the following configuration line:

Code
$MONGO["servers"][$i]["control_users"]["admin"] = "admin";//one of control users ["USERNAME"]=PASSWORD, works only if mongo_auth=false

Change the first "admin" value to your desired username and the second "admin" to your preferred password. Save and exit the editor:

Code
:wq!

Move the extracted RockMongo directory to your web server’s document root:

Console
sudo mv ~/rockmongo-1.1.7 /var/www/html/

After completing the steps above, you can access RockMongo in your browser at:

http://[YourServerIP]/rockmongo-1.1.7

Log in using the customized credentials you defined in the configuration file.

Conclusion

By following the steps outlined above, you’ve successfully set up RockMongo on a CentOS 7 x64 server. This included configuring Apache, PHP, and MongoDB, adjusting system settings for optimal performance, and finally installing and securing the RockMongo interface. You can now manage your MongoDB databases conveniently through a browser-based interface at http://[YourServerIP]/rockmongo-1.1.7.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Databases
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren