Today’s article is specifically designed for GUI lovers. You might be familiar with MongoDB as a DBMS, however, after going through this guide, you will be able to work with it very effectively using the GUI. Therefore, let us get started with the installation procedure of the MongoDB Compass (which is the GUI tool for MongoDB) on Ubuntu 22.04 system. Along with that, we will also be discussing its basic usage so that you can use this tool without any difficulty.

Installation of MongoDB Compass on Ubuntu 22.04:

For installing the GUI of MongoDB and MongoDB Compass on Ubuntu 22.04 system, you will have to perform the following steps:

Step # 1: Updating the System Index:

First, you need to update your system’s index with the command given below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-1.png" data-lazy- height="23" src="data:image/svg xml,” width=”420″>

Step # 2: Downloading MongoDB Compass on Ubuntu 22.04:

Once your system’s index has been updated successfully, you need to download the “.deb” file of MongoDB Compass by running the following command or you can even download it from the official site of MongoDB manually.

$ wget https://downloads.mongodb.com/compass/mongodb-compass_1.15.1_amd64.deb

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-2.png" data-lazy- height="46" src="data:image/svg xml,” width=”646″>

When this command will finish its execution, the output shown below will be presented to you:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-3.png" data-lazy- height="316" src="data:image/svg xml,” width=”644″>

Step # 3: Installing MongoDB Compass on Ubuntu 22.04:

Then, you can install MongoDB Compass on your Ubuntu 22.04 system with the help of the following command:

$ sudo dpkg –i mongodb-compass_1.15.1_amd64.deb

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-4.png" data-lazy- height="25" src="data:image/svg xml,” width=”628″>

Upon a successful installation of the MongoDB Compass on Ubuntu 22.04, the output shown below will appear on the terminal:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-5.png" data-lazy- height="164" src="data:image/svg xml,” width=”634″>

Usage of MongoDB Compass on Ubuntu 22.04:

Before starting to use the MongoDB Compass, you need to ensure that the MongoDB server is running on your Ubuntu 22.04 system. Otherwise, you will not be able to connect to the MongoDB database. Eventually, you will not be able to work with the MongoDB Compass. You can run the MongoDB server by executing the “mongo” command in your system’s terminal. Once the MongoDB server starts running on your system, you can carry out the following steps:

Step # 1: Launching MongoDB Compass on Ubuntu 22.04:

You can launch the MongoDB Compass by looking for it in the Application Menu’s search bar of your Ubuntu 22.04 system and clicking on the relevant search result. The welcome interface of the MongoDB Compass tool is shown in the image below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-6.png" data-lazy- height="823" src="data:image/svg xml,” width=”1431″>

When you close the welcome message dialogue box, you will be presented with the Privacy Settings dialogue box as shown in the following image. From here, you need to click on the Start Using Compass button for proceeding further.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-7.png" data-lazy- height="793" src="data:image/svg xml,” width=”739″>

Step # 2: Connecting to the MongoDB Database in Ubuntu 22.04:

Now, you need to connect to the MongoDB database. For that, you will have to type in your Local Host Address in the space provided and click on the Connect button as shown in the image below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-8.png" data-lazy- height="529" src="data:image/svg xml,” width=”1145″>

Step # 3: Creating a Database and a Collection in MongoDB Compass:

After connecting to the MongoDB database, you can create a database and a collection in MongoDB Compass very easily. You should click on the Databases tab for creating a new database.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-9.png" data-lazy- height="647" src="data:image/svg xml,” width=”1765″>

Here, all the three default databases will be presented to you. You can create a new one by clicking on the Create database button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-10.png" data-lazy- height="674" src="data:image/svg xml,” width=”1455″>

Upon clicking this button, you will be asked to type in the name of your database as well as the name of the collection that you want to create inside this database (you can even create more collections inside the same database later). After providing the names of the database and the collection, you have to click on the Create Database button as shown below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-11.png" data-lazy- height="478" src="data:image/svg xml,” width=”744″>

Step # 4: Inserting a Document in the Collection in MongoDB Compass:

Now, you will be able to see your newly created database within the list of MongoDB databases. For inserting a document inside the newly created collection in your MongoDB database, you first need to expand the database tab by clicking on the name of your particular database as highlighted in the following image:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-12.png" data-lazy- height="842" src="data:image/svg xml,” width=”1763″>

From here, you need to click on the name of your specific collection as shown below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-13.png" data-lazy- height="972" src="data:image/svg xml,” width=”1751″>

Once you are inside your new collection, you need to click on the ADD DATA button and then select the Insert Document option.

<img alt="" data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-14.png" height="126" src="data:image/svg xml,” width=”229″>

After doing this, you will be presented with a sample document as shown in the following image:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-15.png" data-lazy- height="682" src="data:image/svg xml,” width=”742″>

You can remove this sample document and add your own as shown in the image below. In the same manner, you can even insert multiple documents at a time separated from each other by commas. You need to be careful about the syntax of the query. After inserting the document[s], you have to click on the Insert button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-16.png" data-lazy- height="686" src="data:image/svg xml,” width=”742″>

Now, you will be able to see the inserted document[s] inside your collection as shown below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-17.png" data-lazy- height="546" src="data:image/svg xml,” width=”1460″>

Step # 5: Deleting the Document in the Collection in MongoDB Compass:

For deleting a document, you need to hover over it and then click on the remove icon as highlighted in the following image:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-18.png" data-lazy- height="165" src="data:image/svg xml,” width=”1455″>

Then, you need to confirm its deletion by clicking on the DELETE button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-19.png" data-lazy- height="147" src="data:image/svg xml,” width=”1412″>

Step # 6: Deleting the Collection in MongoDB Compass:

Finally, click on the three dots located with its name and then select the Drop Collection option.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-20.png" data-lazy- height="685" src="data:image/svg xml,” width=”311″>

After that, you can provide the confirmation by clicking on the Drop Collection option highlighted in the image shown below:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installation-and-Usage-21.png" data-lazy- height="344" src="data:image/svg xml,” width=”744″>

Conclusion:

This guide was primarily written to deliver two functions: the installation of MongoDB Compass and the use of MongoDB Compass on Ubuntu 22.04. We first talked about the installation of this tool on Ubuntu 22.04 by explaining each. It is followed by the very basic usage of this tool. By following this tutorial, you will easily be able to use MongoDB Compass for creating a database and a collection, inserting documents inside a collection, deleting documents from a collection, and deleting a MongoDB collection.

About the author

<img data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/IMG-20211027-WA0029-150×150.jpg62a7f7fe0034d.jpg" height="112" src="data:image/svg xml,” width=”112″>

Saeed Raza

Hello geeks! I am here to guide you about your tech-related issues. My expertise revolves around Linux, Databases & Programming. Additionally, I am practicing law in Pakistan. Cheers to all of you.