Installation of MongoDB on Ubuntu 12.04
25 Sep '16

Installation of MongoDB on Ubuntu 12.04

How to Install MongoDB on Ubuntu 12.04

MongoDB is a next generation database which is used commonly in many modern web applications. This tutorial should help you setup a virtual private server  to use as a mongodb server in your production application environment.

Step 1 — Create an Ubuntu 12.04 Virtual Server

Creation of ubuntu server can be done by using any of the cloud services such AWS, Rackspace, Microsoft Azure, Digital Ocean, etc., It can be done easily without any difficulties.. Once you’re done, go ahead and `ssh` in to the server.

Step 2 – Creation of Install Script

Installation of MongoDB on ubuntu process is simple enough to be completed with a Bash script. Copy the following into a new file named `install_mongodb.bash` in your home directory:

apt-key adv –keyserver –recv 7F0CEB10
echo “deb dist 10gen” | tee -a /etc/apt/sources.list.d/10gen.list
apt-get -y update
apt-get -y install mongodb-10gen

Now, execute the following command from your home directory:

$ sudo bash ./ install_mongodb.bash

If everything is fine, you may see the output containing a PID of the newly started MongoDB process:

mongodb start/running, process 2368

Step 4 – Verification of the mongodb process

By default, the MongoDB process should start automatically whenever the server is rebooted. You can check whether the mongodb process is running or not by issuing the following command.

$ ps aux | grep mongo

One line of the output should look like the following:

mongodb   765 0.4 6.4 763486 87463 ?       Ssl 16:44   0:05 /usr/bin/mongod –config /etc/mongodb.conf

  • User: `mongodb`
  • PID: `765`
  • Command: `/usr/bin/mongod –config /etc/mongodb.conf`
  • Config File: `/etc/mongodb.conf`

Video tutorial on how to Install Mongodb on Ubuntu 12.04?

About arun

Related Posts

Leave a Reply