Installing Latest MongoDB version on Ubuntu 14.04 LTS 15.04

How to Install MongoDB on Ubuntu 14.04 and 15.04

As we all know that MongoDB is becoming a default choice for certain part of community and is also emphasized as M in MEAN stack. Its an open source NoSQL database that is available free of cost and that you can make use of. In this article I will show you to quickly utilize official MongoDB repository to get and install most recent version of MongoDB.

 

Prerequisites

You will need a running Ubuntu 14.04 server and a sudo non-root user, A great article on setting up such account can be found here

What you need to do

By default, MongoDB package is included in official Ubuntu package repositories, but this does not guarantee that its the latest version, so a better and recommended way to install MongoDB is to Import the MongoDB public GPG key used by the package management system.

Once you are done with above command you will see something like this

Output

Next

Let’s add Mongo repository details to APT, this is required so you have apt  remember where to find MongoDB the next time you want to update it.

Use the commands below

Let’s now update the package list by using the command below

 

Next

We install MongoDB by issuing the command below

When installation finish,  you now have a MongoDB server, Mongo shell, and other Mongo tools such as mongoimport, mongodump etc

You can now verify if MongoDB server s running by issuing the following command

Helpful commands

  1. Stops mongo
    sudo service mongod stop
  2. Start mongo
    sudo service mongod start
  3. Restart mongo
    sudo service mongod restart

You can read more on official Mongo docs website

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

I hope this helps

Cheers.

VN:R_U [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:R_U [1.9.22_1171]
Rating: 0 (from 0 votes)

Comments

  1. A workaround can be found here
    https://jira.mongodb.org/browse/SERVER-17742

  2. Running an Ubuntu server 15.04 in a VM, the apt-get update command can’t find the repositories:

    W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/vivid/mongodb-org/3.0/multiverse/binary-amd64/Packages 404 Not Found

    W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/vivid/mongodb-org/3.0/multiverse/binary-i386/Packages 404 Not Found

Leave a Reply