Install MongoDB on Ubuntu

Firstly, import the MongoDB public GPG key to require that the that the package is signed by the distributor.  I also was required to enable outbound connections on TCP service port 34898 to communicate with the key server using the hkp protocol:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

Now add the distribution for the package to the repository:

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Finally, reload the repository and install the package:

sudo apt-get update
sudo apt-get install mongodb-10gen

Leave a comment