How to setup Mongodb in AWS C9


Old c9 is easy but how to do in AWS?


Having the same issue, anyone got a solution?


I used C9 on AWS for a while and encountered the same problem. The EC2 instance type was t2.micro (1 GiB RAM + 1 vCPU) Red Hat linux, which was completely new to me even though I managed to install Mongodb (version 3.6) following the instruction available at . You may use this command “mongod --bind_ip=$IP --dbpath=/home/ec2-user/environment/data --nojournal” to run the mongodb daemon. If you are like me then you may want to create an Ubuntu EC2 instance and create a c9 ssh space on AWS.
Happy coding.


Can I clone your instance


You don’t have to clone my instance. Just follow the steps below to install MongoDB after creating your EC2 instance for C9.

  1. Run the command sudo nano /etc/yum.repos.d/mongodb-org-3.6.repo on the shell

  2. Copy-paste the following content to the file

    name=MongoDB Repository

  3. Hit ctrl+o and then hit enter to save the file and hit ctrl+x to close the file.

  4. Run the command sudo yum install -y mongodb-org

  5. Run the command mkdir /home/ec2-user/environment/data to create a data directory for your MongoDB data folder.

  6. Run the command mongod --bind_ip=$IP --dbpath=/home/ec2-user/environment/data --nojournal to run the MongoDB daemon process.

That’s all.


Thanks you so much picklu! This wasted so much of my time as there was so much bad info out there.


Thank you very much!