How to install MongoDB GUI admin in AlmaLinux
Need an easy-to-use GUI to help you manage your MongoDB databases? Jack Wallen shows you how to install an administrator just for that purpose.
MongoDB is a NoSQL database that is a great option for those who need to store large amounts of data for highly accessible, scalable applications and services. Out of the box, MongoDB is run entirely from the command line. For some database administrators, this is a great option but for those who prefer GUI tools for taking care of database management, where do you go for this document-based platform?
Views: You need to know the 40+ terms of open source and Linux (TekriPublic Premium)
An alternative is admin, which, like phpMyAdmin, is a simple graphical interface for managing databases. The admin does not have the most advanced looking UI, but it does make working with your MongoDB database much easier.
I want to show you how easy it is to create an admin and run it in AlmaLinux.
What you will need
All you need to install the administrator on AlmaLinux is a user with a running example of the operating system and the sudo feature.
How to install MongoDB
If MongoDB is not already installed in your AlmaLinux instance, let’s do it now. Log in to your server and create a new storage file with:
sudo nano /etc/yum.repos.d/mongodb.repo
In that file, paste the following:
Save and close the file.
Install MongoDB with:
sudo dnf install mongodb-org -y
Start and enable the service with:
sudo systemctl enable --now mongod
You are now ready to install the administrator
How to install admin
First, we will add the necessary dependencies to the command:
dnf install httpd mariadb-server php php-mysqli php-curl php-json -y
Start and enable MariadB with:
sudo systemctl enable --now mariadb
Secure MariaDB installation with the command:
Be sure to set a new password for the administrator user and then answer Y for the remaining questions.
Log in to the MariadB console with:
sudo mysql -u root -p
Create a new database with:
CREATE DATABASE adminer;
Add a new user with the command:
CREATE USER 'adminer'@'localhost' IDENTIFIED BY 'PASSWORD';
Where PASSWORD is a strong / unique password.
Allow the necessary permissions with:
GRANT ALL ON adminer.* TO 'adminer'@'localhost';
Flash permissions and exit Database Console with:
How to download and configure admin
Create a new directory for administrators with the command:
sudo mkdir /var/www/html/adminer
Make changes to the newly created directory with:
Download admin with:
sudo wget -O index.php https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php
Be sure to visit the admin site to check if you have downloaded the latest version.
Appropriate permission to the directory with the following commands:
sudo chown -R apache:apache /var/www/html/adminer/
sudo chmod -R 775 /var/www/html/adminer/
Next, we need to create an Apache configuration file with the command:
sudo nano /etc/httpd/conf.d/adminer.conf
In that file, paste the following:
ServerAdmin [email protected]
CustomLog /var/log/httpd/adminer-access.log combined
Restart Apache with:
sudo systemctl restart httpd
How to access admin
Open a web browser and point it to http: // SERVER (where SERVER is the IP address or domain of the hosting server). You will be given a login screen (Figure A)
You will use the certificate and database name you created earlier, so the administrator for the user, the password you created, and the administrator for the database name. Once you’ve logged in, you’ll see the main window that lets you manage that database (Figure B)
And this is what AlmaLinux has to do with installing the admin MongoDB GUI application. It won’t take long for you to become comfortable using this tool.
Subscribe to TechRepublic How to do tech work on youtube From Jack Wallen to Business Professionals for all the latest technology advice.