
Now to start the mongo shell from the same system running the mongod process, the command is as follows: $ mongoĪlthough, the recommended way of installing MongoDB on Ubuntu is by using apt package manager as it installs the required dependencies during the installation. To start the MongoDB automatically at each boot, the command is: $ sudo systemctl enable mongod

If it is running fine, you will see the below output.

Use the command below to do so: $ sudo systemctl status mongod If the service does not start or you encounter an error like “service not found”, issue the command below: $ sudo systemctl daemon-reloadĪfter starting the mongod service, check its status to verify if it is running fine. To run MongoDB, start the mongod service (daemon for MongoDB) using the command below: $ sudo systemctl start mongod When prompted with the y/n option, press y to continue. Now the MongoDB repository has been added to our system’s list of sources, we can install it as follows: $ sudo apt install mongodb-org Now use the below command to update your system’s repository index: $ sudo apt update To do so, edit the sources.list file using the command below: $ sudo nano /etc/apt/sources.listĪppend the below line in the file: deb focal/mongodb-org/4.4 multiverse If it is added successfully, you will see OK in the output.Īdd MongoDB repository to your system’s list of sources. By doing this, your system will trust the added repository. Step 1: Import MongoDB Public Keyįirst, you will need to add the MongoDB repository key to your apt keyring.

Follow the below instructions to install MongoDB using the Ubuntu package manager. Here, we will show you the installation of the official MongoDB package version 4.4. The MongoDB package available in Ubuntu is not managed by MongoDB Inc. Note: You will require sudo access to install the MongoDB on the Ubuntu OS. We can install MongoDB on Ubuntu through following two ways: You can follow the same procedure on previous Ubuntu releases: Ubuntu 18.04 LTS and 16.04 LTS. This article describes how to install MongoDB on the Ubuntu 20.04 LTS system.

Some of the well-known companies which use MongoDB are Facebook, Cisco, Forbes, Adobe, Nokia, etc. It efficiently works will large-scale data. It is categorized as a NoSQL database as it is a non-relational database and does not work with the conventional table-based relational database structure. MongoDB (known as Mongo) is a document-oriented database management system.
