How to Install & Get start with MongoDb on Ubuntu 20.04

How to Install & Get start with MongoDb on Ubuntu 20.04

MongoDb is one of the most popular opensource NoSQL databases avilable today. Well Known for its great scalability with shardings and fast data processing capabilities with json like document objects and collections.

It also has pwerfull Aggregation framework and cool features like TTL and Capped Collections

You can learn more about mongodb here..

In this post we are going to see how to install community version of mongo database server, mongo shell and perform basic operations on mongodb.

Step 1: Download required packages from mongodb official site

  • Go to Mongodb downloads
  • Select Ubunutu 20.04, select server package and download server deb file
  • Select Ubunutu 20.04, select shell package and download deb file

MongoDb Comunity package downlod page

Step 2: Install downloaded packages

Update your package list..

sudo apt update

Keep downloaded deb files into sperate folder, cd into that directory and then execute below command to install the downloaded packages.

sudo dpkg -i *.deb

if you get any dependency errors run below commands

sudo apt -f install && sudo apt -y upgrade

Check the mongodb status using systemctl command

Afeter succesfull installtion you can checck the status of mongodb server using sudo systemctl status mongod if your mongodb installtion shows inactive status you can start the service using sudo systemctl start mongod.

Additionally you can also set mongodb serice to auto start when you turn on your system by using following command sudo systemctl enable mongod

How to use mongodb through shell

You can find how to conenct mongo shell to mongodb, create, delete database and collections etc in the below video..

you can alos refer my old blog post about using mongodb thrugh shell on ubuntu linux.

Thank You !