Tech Junkie Blog - Real World Tutorials, Happy Coding!: MongoDB In-Depth: Installing MongoDB on Linux

Tuesday, August 14, 2018

MongoDB In-Depth: Installing MongoDB on Linux

In this post we are going to install MongoDB on a Linux operating system.

Here are the steps:

1.  Download the community edition of MongoDB from the page click on the "Linux" tab is selected and select the Linux version that you want

2. After you download the file extract the file with the tar command

tar -zxvf mongodb-linux-x86_64-rhel70-4.0.1.tgz

3. Create a new folder in the /opt/ directory call mongodb with the command mkdir /opt/mongodb

4. Copy the extracted files to the newly created folder with the command

  cp -R -n mongodb-linux-x86_64-rhel70-4.0.1/*  /opt/mongodb

5. Type mongod to verify that MongoDB has been installed

You will noticed that MongoDB tries to start itself but shut itself down because there's no data
folder that it expects. That's easy enough to fix. All you have to do is type in the following command in the terminal mkdir /data mkdir /data/db/ Now you can type mongod to start MongoDB.

No comments:

Post a Comment

Search This Blog