{"id":48477,"date":"2017-07-10T15:00:34","date_gmt":"2017-07-10T12:00:34","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=48477"},"modified":"2017-07-09T22:06:14","modified_gmt":"2017-07-09T19:06:14","slug":"install-mongodb-ubuntu","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/","title":{"rendered":"How to Install MongoDB on Ubuntu"},"content":{"rendered":"<p>Hello, in this tutorial we will see the installation of MongoDB on Ubuntu operating system.<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#toolsUsed\">1.1 Prerequisites<\/a><\/dt>\n<dt><a href=\"#downloadUbuntu\">1.2 Download Ubuntu Operating System<\/a><\/dt>\n<dt><a href=\"#installVmware\">1.3 Download &amp; Install VMware Workstation<\/a><\/dt>\n<dt><a href=\"#installUbuntu\">1.4 Install Ubuntu on VMware Workstation<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#installMongoDbOnUbuntu\">2. Installation of MongoDB on Ubuntu<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#mongoDbRepository\">2.1 Adding MongoDB Repository<\/a><\/dt>\n<dt><a href=\"#mongoDbDatabaseInstallation\">2.2 Installation of MongoDB Database<\/a><\/dt>\n<dt><a href=\"#mongoDbService\">2.3 Start and Stop MongoDB Service<\/a><\/dt>\n<dt><a href=\"#verifyMongoDbInstallation\">2.4 Verifying MongoDB Installation<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#mongoDbUserAccount\">3. Creating MongoDB User Accounts<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#mongoDbAdminAccount\">3.1 Create MongoDB Admin User<\/a><\/dt>\n<dt><a href=\"#addUserForDb\">3.2 Add User for Database<\/a><\/dt>\n<dt><a href=\"#dropUserForDb\">3.3 Drop User for Database<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#mongoDbUninstall\">4. Uninstalling MongoDB<\/a><\/dt>\n<dt><a href=\"#projectConclusion\">5. Conclusion<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>MongoDB is one of the most popular open source NoSQL database solutions available. Unlike relational databases that store rows of data, document-oriented databases like this one store data as documents. These types of databases are not constricted by rigid schemas and scale much easier and efficiently than relational databases, meaning it is a lot easier to store an unthinkable amount of application data.<\/p>\n<p>MongoDB is able to achieve and maintain high performance \u2013 much greater than any relational database, such as Oracle or MySQL. This tutorial will help you to install MongoDB database on Ubuntu 16.04 LTS (Xenial), 14.04 LTS (Trusty) and 12.04 LTS (Precise Pangolin) systems.<\/p>\n<h3><a name=\"toolsUsed\"><\/a>1.1 Prerequisites<\/h3>\n<p>For this tutorial, we need:<\/p>\n<ol>\n<li>Ubuntu Operating System 16.04 LTS (64-bit)<\/li>\n<li>Root privileges<\/li>\n<li>Significant amount of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Random-access_memory\" target=\"_blank\" rel=\"noopener\">RAM<\/a><\/li>\n<\/ol>\n<h3><a name=\"downloadUbuntu\"><\/a>1.2 Download Ubuntu Operating System<\/h3>\n<p>The download is straight forward. Go to Ubuntu website and <a href=\"https:\/\/www.ubuntu.com\/download\/desktop\" target=\"_blank\" rel=\"noopener\">download<\/a> the .ISO image through the direct link. You can also check out the <a href=\"https:\/\/www.ubuntu.com\/download\/alternative-downloads\" target=\"_blank\" rel=\"noopener\">alternate download<\/a> link.<\/p>\n<h3><a name=\"installVmware\"><\/a>1.3 Download &amp; Install VMware Workstation<\/h3>\n<p>You can watch <a href=\"https:\/\/www.youtube.com\/watch?v=6G18b9Ck69A\" target=\"_blank\" rel=\"noopener\">this<\/a> video in order to download and install VMware Workstation on Windows operating system.<\/p>\n<h3><a name=\"installUbuntu\"><\/a>1.4 Install Ubuntu on VMware Workstation<\/h3>\n<p>You can watch <a href=\"https:\/\/www.youtube.com\/watch?v=iJQBlUwIIMc\" target=\"_blank\" rel=\"noopener\">this<\/a> video in order to install the Ubuntu 16.04 LTS Operating System on VMware workstation.<\/p>\n<h2><a name=\"installMongoDbOnUbuntu\"><\/a>2. Installation of MongoDB on Ubuntu<\/h2>\n<p>Below are steps which need to be executed on the Ubuntu operating system in order to successfully perform the MongoDB installation.<\/p>\n<h3><a name=\"mongoDbRepository\"><\/a>2.1 Adding MongoDB Repository<\/h3>\n<p>MongoDB is generally included in the Ubuntu package repositories. However, a legitimate MongoDB repository affords the most up to date version change in an endorsed manner.<\/p>\n<p>To carry out this process, we first must import the key for the legitimate MongoDB repository using the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Import Public Key<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ sudo apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6<\/pre>\n<p><figure id=\"attachment_48478\" aria-describedby=\"caption-attachment-48478\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48478\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-1.jpg\" alt=\"Fig. 1: Add MongoDB Key\" width=\"849\" height=\"127\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-1.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-1-300x45.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-1-768x115.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48478\" class=\"wp-caption-text\">Fig. 1: Add MongoDB Key<\/figcaption><\/figure><\/p>\n<p>After that, we now have to add a file containing the MongoDB repository details under our <code>\/etc\/apt\/sources.list.d\/<\/code> from which the MongoDB package files will be fetched.<\/p>\n<p>Now run the following command as per your version of <strong>Ubuntu<\/strong>:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Ubuntu 16.04<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ echo \"deb [ arch=amd64,arm64 ] http:\/\/repo.mongodb.org\/apt\/ubuntu xenial\/mongodb-org\/3.4 multiverse\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-3.4.list<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Ubuntu 14.04<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ echo \"deb [ arch=amd64 ] http:\/\/repo.mongodb.org\/apt\/ubuntu trusty\/mongodb-org\/3.4 multiverse\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-3.4.list<\/pre>\n<p><span style=\"text-decoration: underline;\"><em>Ubuntu 12.04<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ echo \"deb [ arch=amd64 ] http:\/\/repo.mongodb.org\/apt\/ubuntu precise\/mongodb-org\/3.4 multiverse\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-3.4.list<\/pre>\n<p>Next, update the system package list as follows:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Update System Package<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo apt-get update<\/pre>\n<h3><a name=\"mongoDbDatabaseInstallation\"><\/a>2.2 Installation of MongoDB Database<\/h3>\n<p>After adding the required APT repositories, use the below command to install MongoDB on your systems. It will also install all dependent packages required for MongoDB.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration: underline;\"><em>Install Stable MongoDB Package<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo apt-get install -y mongodb<\/pre>\n<p><figure id=\"attachment_48479\" aria-describedby=\"caption-attachment-48479\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-2.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48479\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-2.jpg\" alt=\"Fig. 2: Install MongoDB in Ubuntu 16.04\" width=\"849\" height=\"319\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-2.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-2-300x113.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-2-768x289.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48479\" class=\"wp-caption-text\">Fig. 2: Install MongoDB in Ubuntu 16.04<\/figcaption><\/figure><\/p>\n<p><strong>Note<\/strong>: If you want to install any <strong>specific<\/strong> version of <strong>MongoDB<\/strong>, define the version number like:<\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ apt-get install mongodb-org=3.4.1 mongodb-org-server=3.4.1 mongodb-org-shell=3.4.1 mongodb-org-mongos=3.4.1 mongodb-org-tools=3.4.10<\/pre>\n<p>The installation command installs <strong>mongodb-org<\/strong>, a <em>meta-package<\/em> that includes the following:<\/p>\n<ol>\n<li><strong>mongodb-org-server<\/strong>: The standard MongoDB daemon and relevant init scripts and configurations<\/li>\n<li><strong>mongodb-org-mongos<\/strong>: The MongoDB Shard daemon<\/li>\n<li><strong>mongodb-org-shell<\/strong>: The MongoDB shell, used to interact with MongoDB via the command line<\/li>\n<li><strong>mongodb-org-tools<\/strong>: Contains a few basic tools to restore, import, and export data, as well as a variety of other functions<\/li>\n<\/ol>\n<h3><a name=\"mongoDbService\"><\/a>2.3 Start and Stop MongoDB Service<\/h3>\n<p>Now, that MongoDB has been successfully installed on your system, there are certain important things we are going to do in order to manage it under <strong>system<\/strong> unit.<\/p>\n<p>The first thing is to create a <strong>systemd unit<\/strong> file which defines a unit, in this case, our <em>MongoDB service<\/em>. Systemd unit configuration files are stored in <code>\/etc\/systemd\/system<\/code> directory and we shall create the <strong>mongodb.service<\/strong> file under it.<\/p>\n<p>Use your editor of choice as follows:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>VI Editor<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo vi \/etc\/systemd\/system\/mongodb.service\r\n<\/pre>\n<p>Then add the following lines into that file:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>MongoDB Service Code<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">[Unit]\r\nDescription=High-performance, schema-free document-oriented database\r\nAfter=network.target\r\n[Service]\r\nUser=mongodb\r\nExecStart=\/usr\/bin\/mongod --quiet --config \/etc\/mongod.conf\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p><figure id=\"attachment_48484\" aria-describedby=\"caption-attachment-48484\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-3.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48484\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-3.jpg\" alt=\"Fig. 3: Creating SystemD MongoDB Service\" width=\"849\" height=\"141\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-3.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-3-300x50.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-3-768x128.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48484\" class=\"wp-caption-text\">Fig. 3: Creating SystemD MongoDB Service<\/figcaption><\/figure><\/p>\n<p>A quick explanation of the file sections:<\/p>\n<ol>\n<li><strong>Unit<\/strong>: Contains a human-readable description of the service and dependencies that need to be started for MongoDB service to work as required<\/li>\n<li><strong>Service<\/strong>: Specifies how the system should start a service depending on the directives provided. The <strong>User directive<\/strong> specifies user to run the MongoDB server and <strong>ExecStart directive<\/strong> specifies the command to start MongoDB service<\/li>\n<li><strong>Install<\/strong>: Directs systemd to start the service at boot time when required<\/li>\n<\/ol>\n<p>At this point, we can now <em>start<\/em> our new service by running the command below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Start MongoDB Service<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo systemctl start mongodb<\/pre>\n<p>To check the <em>status<\/em> of the service, issue the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>MongoDB Status<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo systemctl status mongodb<\/pre>\n<p><figure id=\"attachment_48483\" aria-describedby=\"caption-attachment-48483\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-4.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48483\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-4.jpg\" alt=\"Fig. 4: Start and Verify MongoDB Service\" width=\"849\" height=\"170\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-4.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-4-300x60.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-4-768x154.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48483\" class=\"wp-caption-text\">Fig. 4: Start and Verify MongoDB Service<\/figcaption><\/figure><\/p>\n<p>To <em>stop<\/em> the MongoDB service, issue the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Stop MongoDB Service<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo systemctl stop mongodb\r\n<\/pre>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nTo make the MongoDB services start at <strong>boot time<\/strong>, use the following command: <code>$ sudo systemctl enable mongodb<\/code><\/div>\n<p>All is now set for you to start using MongoDB for developing databases for your applications.<\/p>\n<h3><a name=\"verifyMongoDbInstallation\"><\/a>2.4 Verifying MongoDB Installation<\/h3>\n<p>Finally, use the below command to check installed MongoDB version on your system:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>MongoDB Version<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ mongod -version<\/pre>\n<p><figure id=\"attachment_48485\" aria-describedby=\"caption-attachment-48485\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-5.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48485\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-5.jpg\" alt=\"Fig. 5: Validating MongoDB Version\" width=\"849\" height=\"62\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-5.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-5-300x22.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-5-768x56.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48485\" class=\"wp-caption-text\">Fig. 5: Validating MongoDB Version<\/figcaption><\/figure><\/p>\n<p>Also, connect MongoDB using the command line and execute some test commands for checking proper working.<\/p>\n<p><figure id=\"attachment_48486\" aria-describedby=\"caption-attachment-48486\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-6.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48486\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-6.jpg\" alt=\"Fig. 6: MongoDB Implementation\" width=\"849\" height=\"278\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-6.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-6-300x98.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-6-768x251.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48486\" class=\"wp-caption-text\">Fig. 6: MongoDB Implementation<\/figcaption><\/figure><\/p>\n<h2><a name=\"mongoDbUserAccount\"><\/a>3. Creating MongoDB User Accounts<\/h2>\n<p>The default installation provides you the access to the database using mongo command through command line without authentication.<\/p>\n<h3><a name=\"mongoDbAdminAccount\"><\/a>3.1 Create MongoDB Admin User<\/h3>\n<p>Developers can follow the below steps to create a user with admin privileges in the MongoDB server.<\/p>\n<p><strong>Step 1<\/strong>: Before you set up a username and password for MongoDB, you need to open the MongoDB shell on your server. You can login by typing:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Open MongoDB Shell<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ mongo<\/pre>\n<p><strong>Step 2<\/strong>: Once you are in the MongoDB shell, switch to the database named <em>admin<\/em><\/p>\n<p><span style=\"text-decoration: underline;\"><em>Switch to the Database Admin<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">&gt; use admin;<\/pre>\n<p><strong>Step 3<\/strong>: Create the Root User<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Root User<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">&gt; db.createUser({user:\"myadmin\", pwd:\"admin123\", roles:[{role:\"userAdminAnyDatabase\",db:\"admin\"}]});<\/pre>\n<p>The output will display all the information written to the database except the password.<\/p>\n<p><figure id=\"attachment_48487\" aria-describedby=\"caption-attachment-48487\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-7.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48487\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-7.jpg\" alt=\"Fig. 7: MongoDB User Creation Output\" width=\"849\" height=\"256\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-7.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-7-300x90.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-7-768x232.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48487\" class=\"wp-caption-text\">Fig. 7: MongoDB User Creation Output<\/figcaption><\/figure><\/p>\n<p><strong>Step 4<\/strong>: Exit the mongo shell<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Exit<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">&gt; exit<\/pre>\n<p><strong>Step 5<\/strong>: Restart MongoDB service and try to connect.<\/p>\n<p>Now, restart the MongoDB service.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Restart MongoDB Service<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo systemctl restart mongodb<\/pre>\n<p>And test your connection to MongoDB instance with the credentials created in Step 3, using the admin database for authentication:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>My Admin Credentials<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ mongo -u myadmin -p  --authenticationDatabase admin<\/pre>\n<p>And you will see the output like this:<\/p>\n<p><figure id=\"attachment_48489\" aria-describedby=\"caption-attachment-48489\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-8.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48489\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-8.jpg\" alt=\"Fig. 8: MongoDB User Authentication\" width=\"849\" height=\"171\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-8.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-8-300x60.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-8-768x155.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48489\" class=\"wp-caption-text\">Fig. 8: MongoDB User Authentication<\/figcaption><\/figure><\/p>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nThe <strong>-u<\/strong>, <strong>-p<\/strong>, and <strong>&#8211;authenticationDatabase<\/strong> options in the above command are required in order to authenticate connections to the shell.<\/div>\n<h3><a name=\"addUserForDb\"><\/a>3.2 Add User for Database<\/h3>\n<p>Developers can also create database specific users, i.e. the user will have access to that database only. They can also specify the access level for that user on the database.<\/p>\n<p>For example, we are creating a user account with read-write access on <code>mydb<\/code> database:<\/p>\n<p><strong>Step 1<\/strong>: Create Specific User<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Specific User<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">&gt; db.createUser({user: \"jcg\", pwd: \"jcg123\", roles: [{role:\"readWrite\", db: \"mydb\"}]});<\/pre>\n<p>And you will see the output like this:<\/p>\n<p><figure id=\"attachment_48490\" aria-describedby=\"caption-attachment-48490\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-9.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48490\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-9.jpg\" alt=\"Fig. 9: MongoDB Test User Creation\" width=\"849\" height=\"168\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-9.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-9-300x59.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-9-768x152.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48490\" class=\"wp-caption-text\">Fig. 9: MongoDB Test User Creation<\/figcaption><\/figure><\/p>\n<p><strong>Step 2<\/strong>: To verify authentication use the below command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Validation Of Test User<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$ mongo -u jcg -p --authenticationDatabase mydb<\/pre>\n<p>And you will see the output like this:<\/p>\n<p><figure id=\"attachment_48491\" aria-describedby=\"caption-attachment-48491\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-10.jpg\"><img decoding=\"async\" class=\"size-full wp-image-48491\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-10.jpg\" alt=\"Fig. 10: MongoDB Test User Authentication Output\" width=\"849\" height=\"128\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-10.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-10-300x45.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/07\/mongodb-ubuntu-installation-guide-10-768x116.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-48491\" class=\"wp-caption-text\">Fig. 10: MongoDB Test User Authentication Output<\/figcaption><\/figure><\/p>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nTo list all users for a database, use following command: <code>db.getUsers();<\/code><\/div>\n<h3><a name=\"dropUserForDb\"><\/a>3.3 Drop User for Database<\/h3>\n<p>Developers may also remove a user from the database using the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Validation Of Test User<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">&gt; use mydb;\r\n\r\n&gt; db.dropUser(\"jcg\");\r\n<\/pre>\n<h2><a name=\"mongoDbUninstall\"><\/a>4. Uninstalling MongoDB<\/h2>\n<p>To completely remove MongoDB from a system, developers must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs.<\/p>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nThis process will completely remove MongoDB, its configuration, and <strong>all<\/strong> databases. This process is not <strong>reversible<\/strong>, so ensure that all of your configuration and data is backed up before proceeding.<\/div>\n<p>The following section will guide through the necessary uninstallation steps:<\/p>\n<p><strong>Step 1<\/strong>: To <em>stop<\/em> the MongoDB service, issue the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Stop MongoDB Service<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo systemctl stop mongodb<\/pre>\n<p><strong>Step 2<\/strong>: Remove the MongoDB packages that you had previously installed:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Removing MongoDB Packages<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo apt-get purge mongodb<\/pre>\n<p><strong>Step 3<\/strong>: Remove MongoDB databases and log files:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Removing MongoDB Configuration<\/em><\/span><\/p>\n<pre class=\"brush:bash;\">$ sudo rm -r \/var\/log\/mongodb\r\n\r\n$ sudo rm -r \/var\/lib\/mongodb\r\n<\/pre>\n<p>Hope this helped!<\/p>\n<h2><a name=\"projectConclusion\"><\/a>5. Conclusion<\/h2>\n<p>A well-known NoSQL database that offers high performance, high availability, and automatic scaling is <strong>MongoDB<\/strong>. It is different from the RDBMS such as Oracle, MySQL etc. as it does not use SQL query language to set and retrieve data.<\/p>\n<p>MongoDB stores data in documents called <strong>BSON<\/strong> (Binary Representation of JSON). MongoDB is only available for <strong>64-bit<\/strong> Long Term Support Ubuntu Release.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, in this tutorial we will see the installation of MongoDB on Ubuntu operating system. Table Of Contents 1. Introduction 1.1 Prerequisites 1.2 Download Ubuntu Operating System 1.3 Download &amp; Install VMware Workstation 1.4 Install Ubuntu on VMware Workstation 2. Installation of MongoDB on Ubuntu 2.1 Adding MongoDB Repository 2.2 Installation of MongoDB Database 2.3 &hellip;<\/p>\n","protected":false},"author":119,"featured_media":36154,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1447],"tags":[1194,480],"class_list":["post-48477","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mongodb","tag-mongodb","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install MongoDB on Ubuntu - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install MongoDB on Ubuntu - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-10T12:00:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"How to Install MongoDB on Ubuntu\",\"datePublished\":\"2017-07-10T12:00:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\"},\"wordCount\":1370,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"keywords\":[\"MongoDb\",\"Ubuntu\"],\"articleSection\":[\"MongoDB\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\",\"name\":\"How to Install MongoDB on Ubuntu - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"datePublished\":\"2017-07-10T12:00:34+00:00\",\"description\":\"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MongoDB\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/mongodb\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Install MongoDB on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install MongoDB on Ubuntu - Java Code Geeks","description":"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install MongoDB on Ubuntu - Java Code Geeks","og_description":"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-07-10T12:00:34+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"How to Install MongoDB on Ubuntu","datePublished":"2017-07-10T12:00:34+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/"},"wordCount":1370,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","keywords":["MongoDb","Ubuntu"],"articleSection":["MongoDB"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/","name":"How to Install MongoDB on Ubuntu - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","datePublished":"2017-07-10T12:00:34+00:00","description":"In this tutorial, we will see the installation of MongoDB database on Ubuntu (16.04 LTS - 64-bit (Xenial)) operating system","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/install-mongodb-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"MongoDB","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/mongodb\/"},{"@type":"ListItem","position":4,"name":"How to Install MongoDB on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=48477"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48477\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/36154"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=48477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=48477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=48477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}