Need to know the process of installing MongoDB on Ubuntu 20.04? Here is a complete guide on how to do it.
As part of our Server Management Services here at Ibmi Media, we regularly help our customers Install Software on their Debian and Ubuntu Server.
In this context, we shall look into how to install MongoDB on Ubuntu.
MongoDB is a Robust open-source document database and leading NoSQL database. It is written in C++ and its database helps businesses transform their industries by harnessing the power of data.
MongoDB supports Solaris, Linux, Windows as well as Mac OS X Operating System.
To install MongoDB on Ubuntu, follow the steps below;
To begin, start by updating the system packages with the command below;
sudo apt update
Next, install MongoDB with the following command;
sudo apt install mongodb -y
This will install different packages and dependencies with MongoDB management tools for MongoDB Server.
To confirm if MongoDB Server and database is running, run the following command;
sudo systemctl status mongodb
If active, you will notice that the output will display as service active.
To test if the database is functioning correctly, run the command below;
mongo --eval 'db.runCommand({ connectionStatus: 1 })'
Managing MongoDB service is easy. You can check if the service is active with the command below;
sudo systemctl status mongodb
You can stop the service with the command;
sudo systemctl stop mongodb
To start MongoDB server again, run the command below;
sudo systemctl start mongodb
To restart MongoDB Server, run the command below;
sudo systemctl restart mongodb
By default, MongoDB Service starts automatically after installation. Therefore, if you wish to disable automatic startup, you need to run the command below;
sudo systemctl disable mongodb
To re-enable the service to startup automatically again, run the command below;
sudo systemctl enable mongodb
This article will guide you on how to install MongoDB on Ubuntu.