In recent days NoSQL database is one of the most powerful database engine available, powering different high-performance applications. In general, most NoSQL databases are used in the applications where we will require extremely high read/write operations with low transactional requirements.

e.g. If we are trying to build a Cluster Health statistics logging or Analytics engine or IoT application with power consumptions statistics, then NoSQL database should be the best possible database engine to be used. MongoDB is a very popular name in the NoSQL world which is there in the market since 2009. MongoDB has evolved very fast since it’s inception and currently dominating the market with it’s latest stable version 4.1.x

Today we will try to install MongoDB 4.1.x on Ubuntu 18.04 LTS x86_64 (64 bit) Operating system.

Configure APT repository:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
$ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.1 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org.list
$ sudo apt update

We can choose to install the latest version of the MongoDB server and all related tools by default as follows:

$ sudo apt install mongodb-org

If you need to install a specific version of the MongoDB for project dependencies, then you should also be able to do it as well. In our use case we are trying to install version 4.1.1

$ sudo apt install mongodb-org=4.1.1 mongodb-org-server=4.1.1 mongodb-org-shell=4.1.1 mongodb-org-mongos=4.1.1 mongodb-org-tools=4.1.1

Configure MongoDB Service:

By following above steps you should already have the MongoDB installed into your system, so let’s configure it to start on system boot.

$ sudo systemctl enable mongod
$ sudo systemctl start mongod

Test MongoDB Installation:

$ mongo --version

MongoDB GUI Client:

Robo3T is a very popular GUI client for MongoDB, so you may use Robo3T as MongoDB graphical interface client. This tool provides a rich set of features to have an easy-going MongoDB access.

MongoDB GUI Client