How to install MongoDB Community Edition on ubuntu 16.04/18.04/20.04 LTS - TechBeginner

Welcome to TechBeginner.in, Tech Beginner provides technical blog for Online Linux Tutorials, Ubuntu Tutorials, Redhat Tutorials and CentOS 7, Configuration of server like Web Server, Application server, Database server, Window server, networking, html, css, java script, php, wordpress, opencart, magento, joomla and etc.

How to install MongoDB Community Edition on ubuntu 16.04/18.04/20.04 LTS

Share This




MongoDB is a free and open-source report database. It has a place with a group of databases called NoSQL which are not the same as the customary table-based SQL databases like MySQL and PostgreSQL, In MongoDB, information is put away in adaptable, JSON-like records where fields can fluctuate from report to archive. It doesn't require a predefined construction and information structure can be changed after some time. 


In this post, We will install and configure MongoDB on ubuntu 16.04/18.04/20.04 LTS

 

Step 1: Import the public key

 

You need to add the public key for mongoDB by using the command.

 

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -


Step 2: Add MongoDB Repository
 

In our 2nd step, You need to add the mongoDB repository by using the command.

This is for ubuntu 16.04

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
 

 

This is for ubuntu 18.04

 

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
 

 

This is for ubuntu 20.04 

 

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list



Step 3: Installing MongoDB
 

Now we need to update the ubuntu current repository and install the mongoDB by following the given command.

sudo apt-get update
sudo apt-get install mongodb-org -y

No comments:

Post a Comment