• Home
  • DBA Scripts
    • Oracle Scripts
    • SQL Server Scripts
  • Knowledge Base
    • Oracle Database
    • MS SQL Server
    • MongoDB
    • MariaDB
  • Troubleshoot
    • Oracle Database Issues
    • SQL Server Issues
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • Courses
    • Oracle Database
    • Oracle DBA L1
    • Oracle DBA L2
    • Oracle DBA L3
  • Home
  • DBA Scripts
    • Oracle Scripts
    • SQL Server Scripts
  • Knowledge Base
    • Oracle Database
    • MS SQL Server
    • MongoDB
    • MariaDB
  • Troubleshoot
    • Oracle Database Issues
    • SQL Server Issues
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • Courses
    • Oracle Database
    • Oracle DBA L1
    • Oracle DBA L2
    • Oracle DBA L3
home/Knowledge Base/MongoDB/MongoDB Installation
Popular Search:Oracle, SQL Server, MongoDB

MongoDB Installation

333 views 0 June 2, 2020 April 2, 2021 admin

MongoDB Installation Steps on Windows Server

A. Installing MongoDB on Windows

The version featured in this book is MongoDB 4.0. The minimum requirement for a Windows installation is Windows Server 2008 R2, Windows 7, or later.

Download and install

To download and install MongoDB on Windows, proceed as follows:

1. Go to the MongoDB download center at: https://www.mongodb.com/download- center#community.
2. Select the appropriate operating system where it says Version.
3. Click on DOWNLOAD:


4. When prompted, choose Save File.
5. Click on the saved MSI file to start the installer.
6. Click OK when the security prompt appears asking to Open Executable File?
7. Click Run when the security warning appears.
8. Click Next to start the MongoDB Setup Wizard.
9. Read the license agreement and click on the checkbox and Next. Note that if you do not accept the license agreement the installation will terminate.
10. When asked Choose Setup Type, for the purposes of this illustration, select Complete. MongoDB Compass, which is a handy utility which greatly facilitates database management, is automatically installed.
11. Now that all choices have been made, click on Install and click Yes when the User Account Control security warning pops up.
12. As of MongoDB v4.0, the installation wizard lets you configure startup options. If you want to have MongoDB start automatically and run in the background, choose Run service as Network Service user. You can also configure the directory where MongoDB stores its data files (Data Directory), and where log files are stored (Log Directory):


13. Click Next to continue and Finish when the installation completes.

B. Installing MongoDB on Linux

It is important to understand the MongoDB installation process on Linux, even if you are a developer or IT professional and are not using Linux personally, it’s extremely likely that the internet-facing server you or your customer use is running Linux. W3Techs (https:// w3techs.com/), a company that does web technology surveys, estimates that in 2018, the running on Linux was at 68.1% compared with 32% for Windows. There are three primary considerations when installing MongoDB on Linux, each of which we will address in turn:

  • Linux based upon Debian and Ubuntu
  • Linux based upon RedHat, Fedora, and CentOS
  • Installing directly from source code.

Installing on Debian or Ubuntu Linux

Debian Linux (https://www.debian.org/), self-described as the universal operating system, is a free open-source project that uses a fork of the Linux kernel, and draws heavily upon GNU (http://www.gnu.org/software/software.html, for example, GNU Not Unix) software. Ubuntu Linux (https://www.ubuntu.com/) is produced by the Canonical Group Ltd based in South Africa, and is based upon Debian. For the purposes of this book, we will focus on Ubuntu version 18.04, code-named Bionic Beaver, released in April 2018, a designated LTS (Long Term Support) version.

The preferred way to install any given software on Ubuntu is to use a Debian package. Such packages have the extension *.deb and include a script that tells the package management program where to place the pre-compiled binary files as they are extracted. Popular package management programs include synaptic (http://www.nongnu. org/synaptic/, graphical interface, resolves dependencies, and does a lot of “housekeeping”), aptitude (https://help.ubuntu.com/lts/serverguide/aptitude.html, like synaptic but has a textual, command-line menu), and apt-* (that is apt-get (https:// linux.die.net/man/8/apt-get), apt-key so on: very fast, command-line only). For the purposes of this section we will use apt-get.

The MongoDB packages available for Ubuntu/Debian include the following:

mongodb-org-server Primary MongoDB system daemon
mongodb-org-mongos MongoDB shard routing service
mongodb-org-shell MongoDB shell
mongodb-org-tools Provides various mongo* tools for import, export, restore, and so on.

In addition, a composite package, mongodb-org, which contains all four of these packages, is provided.

Package installation

To install MongoDB on an Ubuntu/Debian server, you will need root access. A unique feature of Debian-based Linux distributions is that direct login as root is not allowed for security reasons. Accordingly, you can promote yourself to root using su, or you can precede the various commands with sudo, which instructs the OS to process this command as root.

Please proceed as follows:

1. Import the public key from the MongoDB key server. This is needed so that the package manager can authenticate the MongoDB package:

2. Add the MongoDB repository to the Linux server's sources list:

3. Refresh the package database from the sources list by running:

sudo apt-get update

4. Install the latest (stable) version of MongoDB. Here, we install only the composite package, which alleviates the need to separately install the four primary packages listed previously:

sudo apt-get install -y mongodb-org

Was this helpful?

Yes  No
Related Articles
  • MongoDB Overview
Leave A Comment Cancel reply

MongoDB
  • MongoDB Installation
  • MongoDB Overview
Popular Articles
  • Upgrade Oracle Database from 11.2.0.3 to 12.1.0.2
  • Upgrading MariaDB on Windows
  • Oracle DBA Basic Interview Questions Part A
  • Purging Oracle Sysaux Tablespace
  • Client – Server Architecture
KB Categories
  • Oracle Database
    • Oracle RAC
    • Oracle ASM
    • Oracle GoldenGate
    • Oracle Tuning
    • Oracle 11g Database
    • Oracle Database Upgrade
    • Oracle 12c Database
    • ALL KB Oracle
    • Oracle 18c Database
    • Oracle Standby Database
  • MongoDB
  • MS SQL Server
  • MySQL
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • MariaDB
Database Organization

Database Organization (DB ORG) is knowledge base for DBA to learn and execute the fundamental of different databases under one website. DB ORG is a non-profit initiative. ORACLE, MS SQL Server, MongoDB, MariaDB, Couchbase

Join Our Community
  • KnowledgeBase
  • Documentation
  • Troubleshoot
  • FAQ
Information Links
  • About DBOrg
  • Licenses
  • Terms
  • Privacy Policy
Contact Us
    DB ORG - Database Administration,
    Knowledge Base for DBA
    Mail: support@databaseorg.com
    WhatsApp: (+91) 9306440957
    Monday to Friday: EST - 11:30 AM to 06:30 PM (IST - 9:00 PM to 4:00 AM)
  • © 2023 Database Organization - DB ORG. All Rights Reserved.

Popular Search:Oracle, SQL Server, MongoDB

WhatsApp DB Org