{"id":26244,"date":"2024-05-03T05:06:27","date_gmt":"2024-05-03T05:06:27","guid":{"rendered":"https:\/\/linuxways.net\/?p=26244"},"modified":"2024-05-03T05:06:39","modified_gmt":"2024-05-03T05:06:39","slug":"install-mongodb-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/install-mongodb-on-ubuntu-24-04\/","title":{"rendered":"How to Install MongoDB on Ubuntu 24.04"},"content":{"rendered":"<p>Having organized structured data is far easier to look up and maintain compared to unstructured data. To keep data organized, there are different database tools like MongoDB. It is a NoSQL document database platform designed to overcome the shortcomings of relational databases and other NoSQL solutions.<\/p>\n<p>It uses a flexible schema for storing data which can be updated or altered at any time, unlike relational databases. MongoDB is supported on multiple operating systems, including the latest version of Ubuntu 24.04 and this guide will discuss its installation process in detail.<\/p>\n<p><strong>Outline:<\/strong><\/p>\n<ul>\n<li><a href=\"#post-26244-_cw5bkff0d8gd\">How to Install MongoDB on Ubuntu 24.04<\/a><\/li>\n<li><a href=\"#post-26244-_hu7fmmj5h3gt\">How to Configure MongoDB on Ubuntu 24.04<\/a><\/li>\n<li><a href=\"#post-26244-_y9e6q519s72b\">How to Remove MongoDB on Ubuntu 24.04<\/a><\/li>\n<li><a href=\"#post-26244-_56gaqvh1rnph\">Conclusion<\/a><\/li>\n<\/ul>\n<h2><a id=\"post-26244-_cw5bkff0d8gd\"><\/a>How to Install MongoDB on Ubuntu 24.04<\/h2>\n<p>MongoDB works pretty well with unstructured and is capable of handling large volumes of data. This makes it suitable for Big Data systems, Map Reduce applications, news site forums, and social networking applications. On Ubuntu 24.04 there is only one way to install MongoDB by far and that is by using its official repository. So first you have to add the GPG key which will verify the authenticity of the MongoDB package so execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-fsSL<\/span> https:<span class=\"sy0\">\/\/<\/span>www.mongodb.org<span class=\"sy0\">\/<\/span>static<span class=\"sy0\">\/<\/span>pgp<span class=\"sy0\">\/<\/span>server-<span class=\"nu0\">7.0<\/span>.asc <span class=\"sy0\">|<\/span> \\<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> gpg <span class=\"re5\">-o<\/span> <span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span>share<span class=\"sy0\">\/<\/span>keyrings<span class=\"sy0\">\/<\/span>mongodb-server-<span class=\"nu0\">7.0<\/span>.gpg \\<br \/>\n<br \/>\n<span class=\"re5\">--dearmor<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"160\" class=\"wp-image-26299\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-1.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-1-300x60.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-1-768x152.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>Now add the MongoDB repository to the sources.list directory, for that the command below first gives the path for the GPG key and then saves the repository link to the sources list directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb [ arch=amd64,arm64 signed-by=\/usr\/share\/keyrings\/mongodb-server-7.0.gpg ] https:\/\/repo.mongodb.org\/apt\/ubuntu jammy\/mongodb-org\/7.0 multiverse&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>mongodb-org-<span class=\"nu0\">7.0<\/span>.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"187\" class=\"wp-image-26359\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-2.png 805w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-2-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-2-768x178.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/p>\n<p>Now update the apt packages list and then use it to install MongoDB on Ubuntu 24.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> <span class=\"re5\">-y<\/span> mongodb-org<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"320\" class=\"wp-image-26370\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-3.png 802w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-3-300x120.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-3-768x306.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/p>\n<p>Just to be sure here I have installed the MongoDB server daemon community version whereas there is another version MongoDB shard routing service. The mongos is suitable only if you are setting up a shared cluster whereas for a standalone MongoDB server mongod is suitable. To verify the installation of MongoDB run the version command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">mongod <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"414\" class=\"wp-image-26381\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-4.png 808w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-4-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-4-768x394.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/p>\n<p><strong>Note:<\/strong> On the <a href=\"https:\/\/www.mongodb.com\/try\/download\/community\">official MongoDB <\/a>website there is its deb file and tar file available for installation which can either be downloaded by selecting the platform and package:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1201\" height=\"694\" class=\"wp-image-26394\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-5.png 1201w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-5-300x173.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-5-1024x592.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-5-768x444.png 768w\" sizes=\"auto, (max-width: 1201px) 100vw, 1201px\" \/><\/p>\n<p>Or you can simply copy the link for it and use the wget utility to download it via the command line:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">wget<\/span> https:<span class=\"sy0\">\/\/<\/span>repo.mongodb.org<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>ubuntu<span class=\"sy0\">\/<\/span>dists<span class=\"sy0\">\/<\/span>jammy<span class=\"sy0\">\/<\/span>mongodb-org<span class=\"sy0\">\/<\/span><span class=\"nu0\">7.0<\/span><span class=\"sy0\">\/<\/span>multiverse<span class=\"sy0\">\/<\/span>binary-arm64<span class=\"sy0\">\/<\/span>mongodb-org-server_7.0.7_arm64.deb<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"421\" class=\"wp-image-26411\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-6.png 808w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-6-300x156.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-6-768x400.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/p>\n<p>The fun part is that when you try to install it through the deb file you will get the error of broken packages and some dependencies issues as in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"277\" class=\"wp-image-26427\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-7.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-7-300x103.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-7-768x264.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>To fix this issue, I have tried installing the missing libraries via apt and adding the repository, which was a total waste of time as the dependency does not have a release file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb http:\/\/security.ubuntu.com\/ubuntu impish-security main&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>impish-security.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"445\" class=\"wp-image-26436\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-8.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-8-300x166.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-8-768x424.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<h2><a id=\"post-26244-_hu7fmmj5h3gt\"><\/a>How to Configure MongoDB on Ubuntu 24.04<\/h2>\n<p>When MongoDB is installed on Ubuntu 24 it is needed to be configured to make it run smoothly. It is usually inactive when installed so to verify it check its service status:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl status mongod<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"191\" class=\"wp-image-26438\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-9.png 803w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-9-300x71.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-9-768x183.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/p>\n<p>Now if it is inactive then first enable it and then start the MongoDB service:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl <span class=\"kw3\">enable<\/span> mongod<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> systemctl start mongod<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"446\" class=\"wp-image-26441\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-10.png 807w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-10-300x166.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-10-768x424.png 768w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/p>\n<p>Now, launch this database management toll execute:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">mongosh<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"571\" class=\"wp-image-26464\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-11.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-11-300x210.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-11-768x537.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<p>By default, there is no user added to the database nor there is authentication required for making any changes in the system. So first move to the admin user by executing:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">use admin<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"268\" class=\"wp-image-26468\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-12.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-12-300x99.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-12-768x253.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>Next, create a user by using the following syntax, here I have created a new admin user but you can grant the role based on your preference:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">db.createUser<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\nuser: <span class=\"st0\">&quot;&lt;desired-user-name&gt;&quot;<\/span>,<br \/>\n<br \/>\npwd: <span class=\"st0\">&quot;&lt;desired-passowrd&gt;&quot;<\/span>,<br \/>\n<br \/>\nroles: <span class=\"br0\">&#91;<\/span> <span class=\"br0\">&#123;<\/span> role: <span class=\"st0\">&quot;root&quot;<\/span>, db: <span class=\"st0\">&quot;admin&quot;<\/span> <span class=\"br0\">&#125;<\/span> <span class=\"br0\">&#93;<\/span><br \/>\n<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"br0\">&#41;<\/span><\/div><\/div>\n<p>Just edit the above syntax paste the whole code and hit enter to execute it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"810\" height=\"205\" class=\"wp-image-26473\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-13.png 810w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-13-300x76.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-13-768x194.png 768w\" sizes=\"auto, (max-width: 810px) 100vw, 810px\" \/><\/p>\n<p>Now verify the user creation by listing MongoDB users:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">show <span class=\"kw2\">users<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"256\" class=\"wp-image-26480\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-14.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-14-300x94.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-14-768x242.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<p>To keep the database secure you need to enable the authentication for logging into the database and to make any changes. Furthermore, to give database access to specified systems enter their respective IP address separated by a comma and set the port t 27017 if not set automatically in the MongoDB configuration file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">security:<br \/>\n<br \/>\nauthorization: enabled<br \/>\n<br \/>\nnet:<br \/>\n<br \/>\nPort: <span class=\"nu0\">27017<\/span><br \/>\n<br \/>\nbindIp: <span class=\"sy0\">&lt;<\/span>give-IPaddress<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Once done with the changes verify them and save the configuration file:<\/p>\n<h2><a id=\"post-26244-_pe9ac9h2rogl\"><\/a><strong><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"425\" class=\"wp-image-26484\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-15.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-15-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-15-768x401.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/strong><\/h2>\n<p>To make communication between the MongoDB server and other systems allow port 27017 through the firewall:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow <span class=\"nu0\">27017<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"378\" class=\"wp-image-26492\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-16.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-16-300x139.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-16-768x357.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<p>Now to apply the changes, restart the MongoDB service on Ubuntu and then verify if the port allowed through the firewall is communicating successfully:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl restart mongod<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> lsof <span class=\"re5\">-i<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> mongo<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"812\" height=\"399\" class=\"wp-image-26501\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-17.png 812w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-17-300x147.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-17-768x377.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<h2><a id=\"post-26244-_y9e6q519s72b\"><\/a>How to Remove MongoDB on Ubuntu 24.04<\/h2>\n<p>To completely remove the MongoDB database tool from Ubuntu 24.04 first uninstall using the apt package manager:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove <span class=\"re5\">--autoremove<\/span> mongodb-org<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"272\" class=\"wp-image-26504\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-18.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-18-300x101.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-18-768x259.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>Next, remove its repository directory in the sources.list.d folder:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>mongodb-org-<span class=\"nu0\">7.0<\/span>.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"187\" class=\"wp-image-26510\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-19.png 803w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-19-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-19-768x179.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/p>\n<p>Lastly, remove the GPG key added in the Ubuntu keyring directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> mongodb-server-<span class=\"nu0\">7.0<\/span>.gpg<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"333\" class=\"wp-image-26513\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-20.png 808w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-20-300x124.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/05\/word-image-26244-20-768x317.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/p>\n<h2><a id=\"post-26244-_56gaqvh1rnph\"><\/a>Conclusion<\/h2>\n<p>MongoDB is a NoSQL document database that is primarily used for applications that require handling a large volume of data with a flexible schema. To install MongoDB on Ubuntu 24.04 there is only one way and that is by adding the repository. For that first, add the GPG key and then add the repository in the sources directory. For MongoDB its deb and tar files are also available but while installing them some library errors are encountered which are no longer supported by Ubuntu24.04.<\/p>","protected":false},"excerpt":{"rendered":"<p>To install MongoDB on Ubuntu 24.04, add the GPG key and then add the repository of the MongoDB in the sources directory.<\/p>","protected":false},"author":113,"featured_media":26536,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-26244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/26244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=26244"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/26244\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/26536"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=26244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=26244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=26244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}