---
title: MongoDB Installation on Amazon Linux
description: MongoDB is an open source NoSQL database that uses a document-oriented data model.
---

[![e-Zest logo\_An accion lab company\_Colour](https://blog.e-zest.com/hubfs/images/Logos%20with%20Tagline/Corporate/SVG/e-Zest%20logo_An%20accion%20lab%20company_Colour.svg "e-Zest logo_An accion lab company_Colour")](https://www.e-zest.com/)

- [WORK](https://www.e-zest.com/our-work)
- [SERVICES](https://www.e-zest.com/our-services) 
    - [Product Engineering](https://www.e-zest.com/digital-product-engineering-services)
    - [Enterprise Data Services](https://www.e-zest.com/enterprise-data-services)
    - [Digital Commerce](https://www.e-zest.com/digital-commerce-services)
    - [Digital Operations](https://www.e-zest.com/digital-operations)
    - [Digital Consulting](https://www.e-zest.com/digital-transformation-consulting-services)
    - [Digital Experience Design](https://www.e-zest.com/digital-experience-design)
- [INSIGHTS](https://blog.e-zest.com/)
- [CAREERS](https://www.e-zest.com/careers)
- [ENTERPRISE DATA SERVICES](https://www.e-zest.com/enterprise-data-services)
- [GENERATIVE AI](https://www.e-zest.com/generative-ai)
- [Healthcare](https://healthcare.e-zest.com)
- [Contact Us](https://www.e-zest.com/contact-us)

- ![Elevating Product Engineering with AI and ML](https://blog.e-zest.com/hubfs/Elevating%20Product%20Engineering%20with%20AI%20and%20ML.jpg)

  [BLOGS](https://blog.e-zest.com)
  
  #### Elevating Product Engineering with AI and ML

  As technology evolves and customer choices broaden, there is an increasing ...

  [Read more](https://blog.e-zest.com/elevating-product-engineering-with-ai-and-ml)
- ![e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024](https://blog.e-zest.com/hubfs/e-Zest%20%E2%80%93%20An%20Accion%20Labs%20Company%20-%20Gets%20Recognition%20as%20a%20Contender%20in%20the%20ISG%20Provider%20LensTM%20Study%20on%20Digital%20Engineering%20Services%202024.jpg)

  [NEWS](https://blog.e-zest.com/news)
  
  #### e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024

  We are delighted to announce that e-Zest – An Accion Labs Company has been ...

  [Read more](https://blog.e-zest.com/news/e-zest-an-accion-labs-company-gets-recognition-as-a-contender-in-the-isg-provider-lens-study-on-digital-engineering-services-2024)
- ![e-Zest Solutions supports Digital Pune Mission](https://blog.e-zest.com/hubfs/blog-files/Digital%20Literacy%20Bus%20e-Zest.png)

  [CSR](https://blog.e-zest.com/csr)
  
  #### e-Zest Solutions supports Digital Pune Mission

  **Pune, India:** e-Zest Solutions, a leading digital technology innovation ...

  [Read more](https://blog.e-zest.com/csr/e-zest-solutions-supports-digital-pune-mission)

- [Work](https://www.e-zest.com/our-work)
- [Services](https://www.e-zest.com/our-services)
- [Insights](https://blog.e-zest.com)
- [Careers](https://www.e-zest.com/careers)
- [Enterprise Data](https://www.e-zest.com/enterprise-data-services)
- [Generative AI](https://www.e-zest.com/generative-ai)
- [Innovations](https://www.e-zest.com/innovations)
- [Healthcare](https://healthcare.e-zest.com)
- [About](https://www.e-zest.com/about-us)
- [Contact](https://www.e-zest.com/contact-us)

- [Blog](https://blog.e-zest.com/)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)

- [![Linkedin Icon](https://blog.e-zest.com/hubfs/icons/linkedin_icon_white.svg)](https://www.linkedin.com/company/e-zest-solutions/)
- [![Twitter Icon](https://blog.e-zest.com/hubfs/twitter-logo-silhouette%20(5).svg)](https://twitter.com/ezest)
- [![Facebook Icon](https://blog.e-zest.com/hubfs/facebook-app-logo%20(4).svg)](https://www.facebook.com/61259256638)
- [![Instagram Icon](https://blog.e-zest.com/hubfs/instagram-logo%20(4).svg)](https://www.instagram.com/ezestsolutions/)
- [![Youtube Icon](https://blog.e-zest.com/hubfs/icons/youtube_icon_white.svg)](https://www.youtube.com/user/ezestcorporate)

[![Go to top icon](https://blog.e-zest.com/hubfs/AA%20Assets/top%20button.svg)](https://blog.e-zest.com/mongodb-installation-on-amazon-linux#top)

Hit enter to search or ESC to close

Insights

e-Zest members share technology ideas to foster digital transformation.

- [Blog](https://blog.e-zest.com)
- [News](https://blog.e-zest.com/news)
- [Podcasts](https://www.e-zest.com/podcasts)
- [Healthcare](https://blog.e-zest.com/healthcare)
- [CSR](https://blog.e-zest.com/csr)
- [Whitepaper](https://blog.e-zest.com/whitepaper)
- [Playbook](https://blog.e-zest.com/playbook)
- [Media Kit](https://www.e-zest.com/media-kit)

# MongoDB Installation on Amazon Linux

[Amit Tidke](https://blog.e-zest.com/author/amit-tidke)  Feb 02, 2017

[Amazon Linux](https://blog.e-zest.com/topic/amazon-linux) [MongoDB](https://blog.e-zest.com/topic/mongodb)

- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/mongodb-installation-on-amazon-linux&title=&summary=&source=>
- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/mongodb-installation-on-amazon-linux&text=MongoDB%20Installation%20on%20Amazon%20Linux>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/mongodb-installation-on-amazon-linux>
- <https://www.instagram.com/ezestsolutions/?u=https://blog.e-zest.com/mongodb-installation-on-amazon-linux>

MongoDB is an open source NoSQL database that uses a document-oriented data model. MongoDB is built on architecture of collection and document, whereas MySQL uses tables and rows. MongoDB uses JSON-like documents with schemas.

**Key features of MongoDB:**

- High performance
- Rich query language
- High availability
- Horizontal scalability
- Support for multiple storage engines

**How to install MongoDB?**

If we want install MongoDB directly using yum then we have to add MongoDB repository. It is recommended to follow the installation steps as a root user.

Create a /etc/yum.repos.d/mongodb-org-3.4.repo

vim /etc/yum.repos.d/mongodb-org-3.4.repo

Add the following lines in the repository file \[mongodb-org-3.4\]

\[mongodb-org-3.4\]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86\_64/

gpgcheck=1

enabled=1

gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

Use the following command to install MongoDB

yum install -y mongodb-org

**Start MongoDB**

We can start mongoDB service by using following command:

servicemongod start

**Verify if MongoDB has started**

You can verify if MongoDB process has started or not by checking the content of MongoDB log file which is located at /var/log/mongodb/mongod.log

You should see following line in log file:  
\[initandlisten\] waiting for connections on port 27017

Where 27017 is default port. You can configure another port in configuration file located at /etc/mongod.conf

If you want to start the MongoDB after every system reboot, you can use following command to do the same

chkconfigmongod on

**Stop MongoDB**

You can use following command to stop MongoDB

servicemongod stop

**Restart MongoDB**

You can use following command to restart MongoDB

servicemongod restart

By Default MongoDB stores its data file in /var/lib/mongo and its log file in

/var/log/mongoDB.

We can specify alternate path for data and log directory by modifying /etc/mongod.conf

**Uninstall MongoDB**

To remove MongoDB completely from the system, we have remove MongoDB application, related configuration files, logs files and any other directories containing data files.

Follow the below steps to remove the MongoDB

- **Stop MongoDB**

Stop MongoDB by using following command

servicemongod stop

- **Remove Packages**

Remove any MongoDB packages that we had previously installed

sudo yum erase $(rpm -qa | grepmongodb-org)

- **Remove Data Directories**

Remove all data and log files

sudorm -r /var/log/mongodb

sudorm -r /var/lib/mongo

- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/mongodb-installation-on-amazon-linux&text=MongoDB%20Installation%20on%20Amazon%20Linux>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/mongodb-installation-on-amazon-linux>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/mongodb-installation-on-amazon-linux&title=&summary=&source=>

### Similar Blog

[![How to enable SMS alerts in Nagios using AWS SNS](https://blog.e-zest.com/hubfs/blog-files/nagios.png) How to enable SMS alerts in Nagios using AWS SNS Nagios is a powerful management and monitoring system. It helps in identifying the IT infrastructure problems. It also helps in ... By Anagha Thorat Feb 06, 2019](https://blog.e-zest.com/how-to-enable-sms-alerts-in-nagios-using-aws-sns)

[![Installation of SVN](https://blog.e-zest.com/hubfs/Svn%201.png) Installation of SVN Subversion is software which help developers to work together and to maintain complete work history. Developers can modify, add ... By Priya Benade Mar 02, 2017](https://blog.e-zest.com/installation-of-svn)

[SSL Encryption using Let’s Encrypt on AWS EC2 Amazon Linux **What is Let’s Encrypt:** By Anagha Thorat Feb 27, 2017](https://blog.e-zest.com/ssl-encryption-using-lets-encrypt-on-aws-ec2-amazon-linux)

[![How to add SSH users in Amazon Linux](https://blog.e-zest.com/hs-fs/file-3586007745-jpg/blog-files/add-ssh-users-in-amazon-linux.jpg) How to add SSH users in Amazon Linux **What Is SSH?** By Priya Benade May 20, 2013](https://blog.e-zest.com/how-to-add-ssh-users-in-amazon-linux/)

[![Install Docker on AWS EC2 (Ubuntu 16.04)](https://blog.e-zest.com/hubfs/install-docker-on-aws-ec2.png) Install Docker on AWS EC2 (Ubuntu 16.04) Docker is a program that can implement a virtualization on your machine and you can pull any image of Operating System and launch ... By Amit Tidke Nov 14, 2018](https://blog.e-zest.com/install-docker-on-aws-ec2)

[Setting up SFTP Server on Amazon EC2 SFTP also known as SSH File Transfer Protocol, enables a secured data transfer between SFTP server and client machine. SFTP ... By Amit Tidke Apr 05, 2017](https://blog.e-zest.com/setting-up-sftp-server-on-amazon-ec2)

[Setup Apache Basic Authentication for your website Apache is most popular web server used nowadays. It is open-source software developed by Apache Software Foundation. By Amit Tidke Sep 28, 2016](https://blog.e-zest.com/setup-apache-basic-authentication-for-your-website)

[![10 most common mistakes you should avoid while managing AWS](https://blog.e-zest.com/hubfs/Presentation1-3.png) 10 most common mistakes you should avoid while managing AWS Amazon Web Services (AWS) is a collection of cloud computing services, also known as web services that make up a cloud platform. ... By Amit Tidke May 23, 2016](https://blog.e-zest.com/10-most-common-mistakes-you-should-avoid-while-managing-aws)

## Helping Organizations Thrive in the Digital Age

[Contact Us](https://www.e-zest.com/contact-us)

- [About](https://www.e-zest.com/about-us)
- [Services](https://www.e-zest.com/our-services)
- [Work](https://www.e-zest.com/our-work)
- [Insights](https://blog.e-zest.com/)
- [Healthcare](https://healthcare.e-zest.com/)
- [Accion Labs](https://www.accionlabs.com/)

- <https://www.linkedin.com/company/e-zest-solutions/>
- <https://twitter.com/ezest>
- <https://www.facebook.com/eZest/>
- <https://www.instagram.com/ezestsolutions/>
- <https://www.youtube.com/user/ezestcorporate>

- Dallas
- Detroit
- Hannover
- Vienna
- London
- Pune

 © 2025 e-Zest Solutions

- [Privacy Policy](https://www.e-zest.com/privacypolicy)
- [Cookie Policy](https://www.e-zest.com/cookie-policy)

 Contact us

 Contact us

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.