Setting Up MongoDB



Hi dears.
I faced with the same problem.
Did you find reason and solved it?


Also problem with installing sudo:


Can you follow the instructions here to install mongodb-org on Amazon Linux? The problem you’re experiencing is that mongodb-org isn’t in the default repos for Amazon Linux, so you have to manually add their own package repos, and then use sudo yum install -y mongodb-org.


Hi Danny,
Thanks for your useful feedback. Successfully installed “sudo yum install -y mongodb-org”
But during running “./mongod” there is error:


Hey Danny, beginner here. I’m trying to follow the steps on the link but I’m a bit confused by what I exactly have to do when creating the /etc/yum.repos.d/mongodb-org-3.6.repo file. Do I create a file inside a certain directory and leave the contents of it blank?

Also, what do I do with

name=MongoDB Repository

Thank you


guys, I spent to install mongodb 5hours, and no one said that it should be installed in yum which different than the the files on the left side in cloud9 ide. what I did.

  1. $ sudo yum-config-manager --add-repo /etc/yum.repos.d/mongodb-org-3.6.repo - copy this to the terminal.
  2. $ sudo yum-config-manager --enable epel (try first without this step)

3.First enter this to the terminal $ sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo - then need to enter the text into terminal : [mongodb-org-3.6]
name=MongoDB Repository

  1. when the text above appears in the terminal press Esc then need to enter :wq (colon +wq) to save the changed file

  2. Now need to install mongodb : $ sudo yum install -y mongodb-org

  3. if you will have error that mongodb conflicts with earlier version or something like this then you need to delete the the pkg with what it conflicts by : ** $ sudo yum remove **

  4. Then go to and continue from the step Run MongoDB Community Edition ($ sudo service mongod start).


Great effort… thanks…


Having the same issue, for some reason it won’t find the package mongodb-org.

If I just run yum install -y mongodb it installs;

But then the ./mongod command won’t work…


How can I install mongodb exactly like c9 into ubuntu 16.04?


Hello, when I install MongoDB, I got this error, could you please help me fix it?


AWS uses Amazon Linux (with the yum package manager), not Ubuntu (uses the apt package manager), which is what the original post was written for, so you need to follow the instructions written by @MetaGS instead:


Hello, I have the same problem. Have you fixed it? Could you please tell me how to fix it?


I have a problem with setting up mongodb.


Instead of using these two lines of command :

`echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"' > mongod`

chmod a+x mongod

Use this :

sudo apt-get install -y mongodb-org

and after that start the database with :