DEV Community

Cover image for How To Install MongoDB Shell On Ubuntu Through The Terminal
Nkenganyi Clovis
Nkenganyi Clovis

Posted on

How To Install MongoDB Shell On Ubuntu Through The Terminal

Let’s start by defining what MongoDB is, then we will see how we can go about the installation process

What is MongoDB? :- MongoDB is a cross platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.

NB: The Mongo shell is an interactive JavaScript interface to MongoDB. You can use the mongo shell to query and update data as well as perform administrative operations.

Now let’s see how the installation process looks like on your Ubuntu System.

--- To start, it is always advised to make sure all your packages are up to date on your ubuntu system by typing the command as seen on the screenshot:

Alt Text

--- You can now run the command to install MongoDB on your Ubuntu terminal by typing the command sudo apt-get install mongodb as seen on the screenshot below:

Alt Text

It will now prompt you a message if you want to continue. Just type letter “y” on your keyboard which is the same as typing “yes” to accept the process to continue.

Alt Text

--- At this point, you will now start the MongoDB service by typing the following command as seen below:

Alt Text

--- From here on, you can check the status of the newly installed mongodb on your machine to check if it’s running or not and if it is succesfully running, you will see active (running) written in green.

Alt Text
--- Now you need to type the following command to start the mongodb server:

Alt Text

Thanks for reading this article.

Please like if you find this article helpful and also follow me to get in touch with all the latest articles I will be posting in the tech world

You can get in touch with me through Linkedin by clicking the link https://www.linkedin.com/in/nkenganyi-clovis-4310b41ba/

Top comments (1)

Collapse
 
fdbozzo profile image
Fernando D. Bozzo • Edited

This will install the WHOLE MongoDB database, not only the SHELL, as the title says.
What if you only want the shell to connect to a remote MongoDB? Do you really need to have a full MongoDB installed and running in your local machine allways?

Edit:
I found the shell alone:
mongodb.com/try/download/shell