{"id":2981,"date":"2019-12-04T09:52:17","date_gmt":"2019-12-04T14:52:17","guid":{"rendered":"http:\/\/bluegalaxy.info\/codewalk\/?p=2981"},"modified":"2019-12-04T09:52:18","modified_gmt":"2019-12-04T14:52:18","slug":"mongodb-how-to-install-mongodb-community-on-mac-and-run-on-localhost","status":"publish","type":"post","link":"https:\/\/bluegalaxy.info\/codewalk\/2019\/12\/04\/mongodb-how-to-install-mongodb-community-on-mac-and-run-on-localhost\/","title":{"rendered":"MongoDB: How to install mongodb-community on Mac and run on localhost"},"content":{"rendered":"\n<p>The goal of this article is to show how to get mongodb-community to run on a Mac at localhost:27017. This assumes that <a href=\"https:\/\/brew.sh\/\">Homebrew<\/a> has already been installed on your Mac machine. <br><br>Using a terminal or bash window, start with the following brew command:<br><code>brew tap mongodb\/brew<\/code><\/p>\n\n\n\n<p>In this screenshot, I used this command after I already installed mongodb-community, so the command updates the associated taps:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"227\" src=\"http:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-1024x227.png\" alt=\"\" class=\"wp-image-2984\" srcset=\"https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-1024x227.png 1024w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-300x67.png 300w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-768x170.png 768w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-1536x341.png 1536w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3-676x150.png 676w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-3.png 1874w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Then use this command:<br><code>brew install mongodb-community<\/code><br><br>Once this is done, run the following command to run mongodb-community as a service:<br><code>brew services start mongodb-community<\/code><\/p>\n\n\n\n<p>Then run the following command to test the mongodb installation:<br><code>mongo<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"209\" src=\"http:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-1024x209.png\" alt=\"\" class=\"wp-image-2985\" srcset=\"https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-1024x209.png 1024w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-300x61.png 300w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-768x157.png 768w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-1536x314.png 1536w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4-676x138.png 676w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-4.png 1890w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For more details about these commands, see:<br><a href=\"https:\/\/github.com\/mongodb\/homebrew-brew\">https:\/\/github.com\/mongodb\/homebrew-brew<\/a><\/p>\n\n\n\n<p>The default port for mongo is 27017, so if all is working properly we should get a mongo response on localhost at this port. For example:<br><a href=\"http:\/\/localhost:27017\/\">http:\/\/localhost:27017\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5-1024x171.png\" alt=\"\" class=\"wp-image-2987\" width=\"445\" height=\"74\" srcset=\"https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5-1024x171.png 1024w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5-300x50.png 300w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5-768x128.png 768w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5-676x113.png 676w, https:\/\/bluegalaxy.info\/codewalk\/wp-content\/uploads\/2019\/12\/image-5.png 1376w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/figure>\n\n\n\n<p>Success!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The goal of this article is to show how to get mongodb-community to run on a Mac at localhost:27017. This assumes that Homebrew has already been installed on your Mac machine. Using a terminal or bash window, start with the following brew command:brew tap mongodb\/brew In this screenshot, I used this command after I already &hellip; <a href=\"https:\/\/bluegalaxy.info\/codewalk\/2019\/12\/04\/mongodb-how-to-install-mongodb-community-on-mac-and-run-on-localhost\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">MongoDB: How to install mongodb-community on Mac and run on localhost<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[216,115],"class_list":["post-2981","post","type-post","status-publish","format-standard","hentry","category-technologies-and-tools","tag-homebrew","tag-mongodb"],"_links":{"self":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/2981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/comments?post=2981"}],"version-history":[{"count":7,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/2981\/revisions"}],"predecessor-version":[{"id":2991,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/2981\/revisions\/2991"}],"wp:attachment":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/media?parent=2981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/categories?post=2981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/tags?post=2981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}