{"id":3920,"date":"2017-11-30T13:32:10","date_gmt":"2017-11-30T18:32:10","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=3920"},"modified":"2017-11-30T13:32:10","modified_gmt":"2017-11-30T18:32:10","slug":"install-mongodb-debian-9","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/","title":{"rendered":"How to Install MongoDB on Debian 9"},"content":{"rendered":"<h1>How to Install MongoDB on Debian 9 <\/h1>\n<div class=\"row\">\n<div class=\"col-lg-10\">\n<p>MongoDB is a free, open-source <a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Document-oriented_database\" target=\"_blank\">document-oriented database<\/a>, which is classified as a NoSQL database; NoSQL databases are not relational databases but are based on other data storage and retrieval means. Unlike other database programs, such as MySQL and MariaDB, MongoDB is based on JSON-like documents that are flexible, which means fields in different documents can vary and the data structure can change over time. MongoDB also provides users with high availability, smooth scaling, and simple geographic distribution, making it an efficiently utilized solution.<\/p>\n<\/div>\n<div class=\"col-lg-2\">\n<img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"609\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png\" alt=\"install mongodb\" class=\"alignright size-full wp-image-3831\" \/>\n<\/div>\n<\/div>\n<p>MongoDB was released in February of 2009 and is made available for free use while offering commercial support and other services to consumers.<\/p>\n<h2>Getting Started<\/h2>\n<p>To install MongoDB on Debian 9, sometimes called Debian Stretch, you will need one node that is running the Linux Debian 9 operating system; the node you choose may be a <a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\"><b>cloud server<\/b><\/a> node or <a href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\"><b>dedicated server<\/b><\/a> node. The operating system needs to be up to date, and you will need root access to your server.<\/p>\n<p>Root access normally requires a root username and root password, and this allows you to execute commands with higher levels of authority than a standard user would have access to execute.<\/p>\n<h2>How to Install MongoDB on Debian 9<\/h2>\n<p>The first thing to remember is that each command executed below is executed with root user access.<\/p>\n<p>First, it&#8217;s essential to update the server before attempting to install MongoDB:<br \/>\n<code>apt-get update && apt-get upgrade -y<\/code><\/p>\n<p>When the server is finishing updating, it&#8217;s time to install MongoDB:<br \/>\n<code>apt-get install mongodb<\/code><\/p>\n<p>Once MongoDB is installed, you will need to start and stop MongoDB, verifying that it functions correctly:<br \/>\n<code>systemctl start mongodb<br \/>\nsystemctl stop mongodb<\/code><\/p>\n<p>Now you can check your MongoDB version, making sure it&#8217;s the proper version or the version you were expecting:<br \/>\n<code>mongod --version<\/code><br \/>\n<code class=\"gris\">db version v3.2.11<br \/>\ngit version: 009580ad490190ba33d1c6253ebd8d91808923e4<br \/>\nOpenSSL version: OpenSSL 1.0.2l  25 May 2017<br \/>\nallocator: tcmalloc<br \/>\nmodules: none<br \/>\nbuild environment:<br \/>\ndistarch: x86_64<br \/>\ntarget_arch: x86_64<\/code><\/p>\n<p>After completing the installation and verifying the MongoDB version, it&#8217;s time to test MongoDB, making sure it functions as anticipated on your server:<br \/>\n<code>mongo<\/code><br \/>\n<code class=\"gris\">MongoDB shell version: 3.2.11<br \/>\nconnecting to: test<br \/>\n> help<br \/>\n    db.help()                    help on db methods<br \/>\n    db.mycoll.help()             help on collection methods<br \/>\n    sh.help()                    sharding helpers<br \/>\n    rs.help()                    replica set helpers<br \/>\n    help admin                   administrative help<br \/>\n    help connect                 connecting to a db help<br \/>\n    help keys                    key shortcuts<br \/>\n    help misc                    misc things to know<br \/>\n    help mr                      mapreduce<br \/>\n    show dbs                     show database names<br \/>\n    show collections             show collections in current database<br \/>\n    show users                   show users in current database<br \/>\n    show profile                 show most recent system.profile entries with time >= 1ms<br \/>\n    show logs                    show the accessible logger names<br \/>\n    show log [name]              prints out the last segment of log in memory, 'global' is default<br \/>\n    use <db_name>                set current database<br \/>\n    db.foo.find()                list objects in collection foo<br \/>\n    db.foo.find( { a : 1 } )     list objects in foo where a == 1<br \/>\n    it                           result of the last line evaluated; use to further iterate<br \/>\n    DBQuery.shellBatchSize = x   set default number of items to display on shell<br \/>\n    exit                         quit the mongo shell<br \/>\n> exit<br \/>\nbye<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Congratulations, you&#8217;ve completed installing MongoDB on Linux Debian 9, and it&#8217;s time to move your server into production. If you found this guide helpful, please share it with other users that are interested in setting up the same document-oriented database system. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to Install MongoDB on Debian 9 MongoDB is a free, open-source document-oriented database, which is classified as a NoSQL database; NoSQL databases are not relational databases but are based on other data storage and retrieval means. Unlike other database programs, such as MySQL and MariaDB, MongoDB is based on JSON-like documents that are flexible,<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-3920","post","type-post","status-publish","format-standard","hentry","category-database","operating_system-debian"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install MongoDB on Debian 9 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/\" \/>\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 Debian 9 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-30T18:32:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/\",\"name\":\"How to Install MongoDB on Debian 9 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png\",\"datePublished\":\"2017-11-30T18:32:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png\",\"width\":640,\"height\":609,\"caption\":\"install mongodb\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install MongoDB on Debian 9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install MongoDB on Debian 9 - Globo.Tech","description":"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...","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:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/","og_locale":"en_US","og_type":"article","og_title":"How to Install MongoDB on Debian 9 - Globo.Tech","og_description":"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...","og_url":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/","og_site_name":"Globo.Tech","article_published_time":"2017-11-30T18:32:10+00:00","og_image":[{"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png","type":"","width":"","height":""}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/","url":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/","name":"How to Install MongoDB on Debian 9 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png","datePublished":"2017-11-30T18:32:10+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"How to Install MongoDB on Debian 9: MongoDB is a free, open-source document-oriented database , which is classified as a NoSQL database; NoSQL databases...","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/database-155892_640.png","width":640,"height":609,"caption":"install mongodb"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-mongodb-debian-9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install MongoDB on Debian 9"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=3920"}],"version-history":[{"count":4,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3920\/revisions"}],"predecessor-version":[{"id":3924,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3920\/revisions\/3924"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=3920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=3920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=3920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}