How to Install MongoDB on Ubuntu 22.04


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing MongoDB on Ubuntu 22.04

MongoDB is a popular NoSQL database management system that provides high performance, scalability, and flexibility. In this tutorial, we will guide you through the process of installing MongoDB on Ubuntu 22.04.


  • Ubuntu 22.04 installed
  • Root access or a user with sudo privileges

Step 1: Importing the MongoDB GPG Key

Start by importing the MongoDB's GPG key for package verification. Open the terminal and execute the following command:

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

Step 2: Adding the MongoDB Repository

Next, add the official MongoDB repository to your system's package sources list:

$ echo "deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Step 3: Updating the Package Repository

Now, update the package repository to ensure you have the latest available packages by running the following command:

$ sudo apt update

Step 4: Installing MongoDB

Once the package repository is updated, you can proceed with installing MongoDB using the following command:

$ sudo apt install -y mongodb-org

Step 5: Starting and Enabling the MongoDB Service

After the installation is complete, MongoDB is not started automatically. You can start and enable the MongoDB service using the following commands:

$ sudo systemctl start mongod
$ sudo systemctl enable mongod

Step 6: Verifying the MongoDB Installation

Lastly, verify the MongoDB installation to ensure it has been successfully installed. Run the following command:

$ mongo --eval "db.version()"

If the installation is successful, you will see the version information of MongoDB outputted in the terminal.


Congratulations! You have successfully installed MongoDB on Ubuntu 22.04. MongoDB is now ready to use for your applications, and you can start working with its powerful NoSQL database features.

Refer A Friend
Get $25

Installing MongoDB on Ubuntu 22.04
MongoDB installation on Ubuntu 22.04
How to install MongoDB on Ubuntu 22.04
Ubuntu 22.04 MongoDB installation guide
MongoDB setup on Ubuntu 22.04
Ubuntu 22.04 MongoDB installation steps
Installing MongoDB on Ubuntu version 22.04
MongoDB installation tutorial for Ubuntu 22.04
Step-by-step guide to install MongoDB on Ubuntu 22.04
Easy MongoDB installation on Ubuntu 22.04

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.