{"id":3230,"date":"2023-04-13T12:38:30","date_gmt":"2023-04-13T09:38:30","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3230"},"modified":"2023-04-11T14:03:56","modified_gmt":"2023-04-11T11:03:56","slug":"how-to-install-mongodb-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/","title":{"rendered":"How to install MongoDB on Ubuntu"},"content":{"rendered":"\n<p>Welcome to this comprehensive guide on how to install MongoDB on Ubuntu! In the following steps, you will learn everything you need to know to set up MongoDB on your Ubuntu system. Whether you&#8217;re a beginner or an experienced user, this guide will walk you through the installation process, providing clear and concise instructions to ensure your success. So, let&#8217;s dive in and get started with the MongoDB installation process!<\/p>\n\n\n\n<p>MongoDB is a popular NoSQL database that is designed for scalability, flexibility, and ease of use. It is a powerful database that can handle large amounts of data and provides advanced features such as sharding and replication.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_1_Import_the_MongoDB_public_key\" title=\"Step 1: Import the MongoDB public key\">Step 1: Import the MongoDB public key<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_2_Add_the_MongoDB_repository\" title=\"Step 2: Add the MongoDB repository\">Step 2: Add the MongoDB repository<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_3_Install_MongoDB_on_Ubuntu\" title=\"Step 3: Install MongoDB on Ubuntu\">Step 3: Install MongoDB on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_4_Start_MongoDB_on_Ubuntu\" title=\"Step 4: Start MongoDB on Ubuntu\">Step 4: Start MongoDB on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_5_Verify_MongoDB_on_Ubuntu\" title=\"Step 5: Verify MongoDB on Ubuntu\">Step 5: Verify MongoDB on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Step_6_Configure_MongoDB_on_Ubuntu\" title=\"Step 6: Configure MongoDB on Ubuntu\">Step 6: Configure MongoDB on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Import_the_MongoDB_public_key\"><\/span>Step 1: Import the MongoDB public key<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To start, we need to import the MongoDB public key to verify the authenticity of the package we are going to install. Run the following command to import the key:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>curl -fsSL https:\/\/www.mongodb.org\/static\/pgp\/server-4.4.asc | sudo apt-key add -<\/code><\/pre>\n\n\n\n<p>This command will download the public key and add it to the keyring.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"168\" data-attachment-id=\"3231\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/attachment\/screenshot-2023-04-11-at-13-02-37\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.02.37.png?fit=720%2C168&amp;ssl=1\" data-orig-size=\"720,168\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-04-11-at-13.02.37\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.02.37.png?fit=720%2C168&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.02.37.png?resize=720%2C168&#038;ssl=1\" alt=\"How to install MongoDB on Ubuntu \" class=\"wp-image-3231\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.02.37.png?w=720&amp;ssl=1 720w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.02.37.png?resize=300%2C70&amp;ssl=1 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>apt-key list<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"175\" data-attachment-id=\"3232\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/attachment\/screenshot-2023-04-11-at-13-03-45\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.03.45.png?fit=760%2C177&amp;ssl=1\" data-orig-size=\"760,177\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-04-11-at-13.03.45\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.03.45.png?fit=750%2C175&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.03.45.png?resize=750%2C175&#038;ssl=1\" alt=\"Import the MongoDB public key\" class=\"wp-image-3232\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.03.45.png?w=760&amp;ssl=1 760w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.03.45.png?resize=300%2C70&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Add_the_MongoDB_repository\"><\/span>Step 2: Add the MongoDB repository<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Next, we need to add the MongoDB repository to our system. To do this, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>echo \"deb &#91; 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<\/code><\/pre>\n\n\n\n<p>This command will add the repository to the sources list file.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"97\" data-attachment-id=\"3233\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/attachment\/screenshot-2023-04-11-at-13-07-11\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?fit=1278%2C166&amp;ssl=1\" data-orig-size=\"1278,166\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-04-11-at-13.07.11\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?fit=750%2C97&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?resize=750%2C97&#038;ssl=1\" alt=\"Add the MongoDB repository\" class=\"wp-image-3233\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?resize=1024%2C133&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?resize=300%2C39&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?resize=768%2C100&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.07.11.png?w=1278&amp;ssl=1 1278w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Install_MongoDB_on_Ubuntu\"><\/span>Step 3: Install MongoDB on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now that we have added the repository, we can install MongoDB on our system. Run the following command to update the package list:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>After updating the package list, we can install MongoDB with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install mongodb-org<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"148\" data-attachment-id=\"3234\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/attachment\/screenshot-2023-04-11-at-13-11-30\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?fit=1173%2C231&amp;ssl=1\" data-orig-size=\"1173,231\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-04-11-at-13.11.30\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?fit=750%2C148&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?resize=750%2C148&#038;ssl=1\" alt=\"Install MongoDB\" class=\"wp-image-3234\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?resize=1024%2C202&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?resize=300%2C59&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?resize=768%2C151&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.11.30.png?w=1173&amp;ssl=1 1173w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Start_MongoDB_on_Ubuntu\"><\/span>Step 4: Start MongoDB on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once the installation is complete, we need to start the MongoDB service. Run the following command to start the service:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl start mongod<\/code><\/pre>\n\n\n\n<p>You can also enable the service to start automatically at boot time with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl enable mongod\n\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/mongod.service \u2192 \/lib\/systemd\/system\/mongod.service.<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_5_Verify_MongoDB_on_Ubuntu\"><\/span>Step 5: Verify MongoDB on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To verify that MongoDB is installed and running, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl status mongod<\/code><\/pre>\n\n\n\n<p>This command will display the status of the MongoDB service. If it is running, you will see a message similar to the following:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"283\" data-attachment-id=\"3235\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu\/attachment\/screenshot-2023-04-11-at-13-57-56\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?fit=820%2C309&amp;ssl=1\" data-orig-size=\"820,309\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-04-11-at-13.57.56\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?fit=750%2C283&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?resize=750%2C283&#038;ssl=1\" alt=\"Verify MongoDB installation\" class=\"wp-image-3235\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?w=820&amp;ssl=1 820w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Screenshot-2023-04-11-at-13.57.56.png?resize=768%2C289&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p>Congratulations! You have successfully installed MongoDB on Ubuntu 22.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_6_Configure_MongoDB_on_Ubuntu\"><\/span>Step 6: Configure MongoDB on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>By default, MongoDB listens on the localhost interface only. If you want to access MongoDB from other machines, you need to configure it to listen on all interfaces or a specific IP address.<\/p>\n\n\n\n<p>To do this, you need to edit the MongoDB configuration file at <code>\/etc\/mongod.conf<\/code>. Open the file with your favorite text editor and find the <code>net<\/code> section. Uncomment the <code>bindIp<\/code> line and set it to `0.0.0.0` to listen on all interfaces or set it to a specific IP address if you only want to listen on that address.<\/p>\n\n\n\n<p>After making the changes, save the file and restart the MongoDB service for the changes to take effect:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl restart mongod<\/code><\/pre>\n\n\n\n<p>You can also configure other settings in the <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/mongodb\/\">MongoDB configuration file<\/a>, such as storage options, logging, and security. Refer to the MongoDB documentation for more information on how to configure MongoDB.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-header-gradient-color has-text-color\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this tutorial, we have shown you how to install MongoDB on Ubuntu. We started by importing the MongoDB public key and adding the MongoDB repository to the sources list. Then, we installed MongoDB using the package manager and started the MongoDB service. Finally, we verified that MongoDB was running and showed you how to configure MongoDB.<\/p>\n\n\n\n<p>Now that you have MongoDB installed, you can start using it to store and manage your data. MongoDB provides a flexible schema and supports a wide range of use cases, including document storage, analytics, and search. Enjoy using MongoDB on Ubuntu!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to this comprehensive guide on how to install MongoDB on Ubuntu! In the following steps, you will learn everything you need to know to set up MongoDB on your Ubuntu system. Whether you&#8217;re a beginner or an experienced user, this guide will walk you through the installation process, providing<\/p>\n","protected":false},"author":8,"featured_media":3236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[277,271,269,272,270,273,274,275,276],"class_list":["post-3230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-configure-mongodb","tag-how-to-install-mongodb","tag-install-mongodb","tag-install-mongodb-on-ubuntu","tag-mongodb-on-ubuntu","tag-mongodb-public-key","tag-mongodb-repository","tag-start-mongodb","tag-verify-mongodb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-install-MongoDB-Ubuntu-22.png?fit=600%2C330&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-Q6","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1067,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-ubuntu-16-04\/","url_meta":{"origin":3230,"position":0},"title":"How to Install MongoDB on Ubuntu 16.04","author":"Shreyash Sharma","date":"October 9, 2017","format":false,"excerpt":"Introduction MongoDB it is a document-oriented database. It is a free and open-source database. It does not rely on a traditional table-based relational database structure that\u2019s why it is classified as a NoSQL database. Instead it uses JSON-like documents with dynamic schemas. Before you add data to database MongoDB does\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3687,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-mongodb-on-kubernetes\/","url_meta":{"origin":3230,"position":1},"title":"How to Deploy MongoDB on Kubernetes","author":"George B.","date":"July 29, 2023","format":false,"excerpt":"This tutorial will walk you through installing MongoDB on Kubernetes cluster. We'll assume that you've already got K3s and Helm set up on your machine. The deployment of applications like MongoDB on Kubernetes cluster is made easier by the Kubernetes package manager Helm. Before getting too technical, it's important to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-MongoDB-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":965,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-debian-8\/","url_meta":{"origin":3230,"position":2},"title":"How to Install MongoDB on Debian 8","author":"Daniel Draga","date":"June 11, 2017","format":false,"excerpt":"Introduction Part of the MEAN stack MongoDB is the new\u00a0NoSQL document database that is being implemented within modern web applications. So using MongoDB in your own application will give it the edge, you will be able to deal with a large amount of data. On top of all that you\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1127,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/mongodb\/","url_meta":{"origin":3230,"position":3},"title":"MongoDB","author":"Shreyash Sharma","date":"October 17, 2017","format":false,"excerpt":"Series:\u00a0Introduction to the MEAN Stack Part 1: Definition of the MEAN stack Part 2:\u00a0Setup of the MEAN stack Part 3:\u00a0Node.js Part 4:\u00a0npm Part 5:\u00a0Connect Part 6:\u00a0Express Part 7:\u00a0MongoDB Part 8:\u00a0Mongoose Part 9:\u00a0REST Part 10:\u00a0Baucis Part 11:\u00a0Bower Part 12:\u00a0AngularJS Part 13:\u00a0Restangular So far our server has only returned static data: files\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb-1.jpeg?fit=1040%2C560&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1089,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/setup-of-the-mean-stack\/","url_meta":{"origin":3230,"position":4},"title":"Setup of the MEAN stack","author":"Daniel Draga","date":"October 9, 2017","format":false,"excerpt":"Series:\u00a0Introduction to the MEAN Stack Part 1: Definition of the MEAN stack Part 2:\u00a0Setup of the MEAN stack Part 3:\u00a0Node.js Part 4:\u00a0npm Part 5:\u00a0Connect Part 6:\u00a0Express Part 7:\u00a0MongoDB Part 8:\u00a0Mongoose Part 9:\u00a0REST Part 10:\u00a0Baucis Part 11:\u00a0Bower Part 12:\u00a0AngularJS Part 13:\u00a0Restangular In this article, we will lay out the basics for\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/meanjs-1024x492.png?fit=1024%2C492&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/meanjs-1024x492.png?fit=1024%2C492&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/meanjs-1024x492.png?fit=1024%2C492&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/meanjs-1024x492.png?fit=1024%2C492&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1068,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/mongodb-and-nosql-databases\/","url_meta":{"origin":3230,"position":5},"title":"MongoDB And NoSQL Databases","author":"Shreyash Sharma","date":"October 9, 2017","format":false,"excerpt":"Introduction MongoDB it is a document-oriented database. It is a free and open-source database. It does not rely on a traditional table-based relational database structure that\u2019s why it is classified as a NoSQL database. Instead it uses JSON-like documents with dynamic schemas. Before you add data to database MongoDB does\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb.jpeg?fit=1040%2C560&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb.jpeg?fit=1040%2C560&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/10\/mongodb.jpeg?fit=1040%2C560&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3230"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3230\/revisions"}],"predecessor-version":[{"id":3237,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3230\/revisions\/3237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3236"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}