While trying to install
mongod on my Cloud9 AWS, I ran into some troubles. For my own future reference and posterity, I’m making this post.
mongodis the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations.
Create an AWS account & go through all the verification steps.
Under services on the AWS dashboard do a search for “Cloud9”.
Spin up a new free tier Cloud9 server – be sure to select the ubuntu/linux option instead of amazon’s linux (see image below).
In the terminal run
node -v (Note: at the time of writing this the version is
npm init (you can add the -y flag to auto finish and edit the package.json file later if you like).
Do The Needful
sudo apt install mongodb-clients – this will install mongo. You will be prompted to type
Y⏎ to continue.
sudo apt install mongodb-server-core
cd to go to the root folder above the workspace. If you type
pwd you should see
Now for the next bits you will need to be logged in as a super user but not just sudo.
sudo su – your prompt should change showing something like
While a super user you will need to run the following commands:
# mkdir -p /data/db #
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "[email protected]"' > mongod#
chmod a+x mongod# mongod
mongod should start running now allowing you to access
mongo with a final line reading something like this:
2019-12-14T06:11:39.395+0000 I NETWORK [initandlisten] waiting for connections on port 27017. Note you will need to stay logged in as
sudo u on that terminal window to run mongod again.
Leave that terminal alone – don’t touch it, it’s just going to run in the background. Create a new terminal
mongo then create a new terminal