Posted inlinux / Technology

How to Install MongoDB on Ubuntu?

You can install MongoDB on Ubuntu by following these steps:
Open a terminal window.
Import the MongoDB public GPG key by running the following command:

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

Create a MongoDB source list file by running the following command:

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

Note that the above command is for Ubuntu 20.04 (Focal Fossa). If you are using a different version of Ubuntu, you should replace “focal” in the command with the appropriate codename for your version.

Update the package list by running the following command:

sudo apt-get update

Install MongoDB by running the following command:

sudo apt-get install -y mongodb-org

Once the installation is complete, MongoDB should be automatically started. However, you can check its status by running:

sudo systemctl status mongod

This should show that MongoDB is active and running.

That’s it! MongoDB should now be installed and running on your Ubuntu system.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype