Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Forked from next-marianmoldovan/mongoinstall.sh
Last active April 18, 2017 04:45
Show Gist options
  • Save bashkirtsevich/ad5a483e1eb9860ee182b03b7e496613 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/ad5a483e1eb9860ee182b03b7e496613 to your computer and use it in GitHub Desktop.
Install mongodb

Using Debian's Packages

sudo apt-get update  
sudo apt-get install mongodb-server -y  

This will result in you installing a shell and server of version 2.4.10

Using MongoDB's Apt Repository

This method allows your system to receive the latest stable version of MongoDB, but one that is deemed stable by the MongoDB team, not the Debian team. First add their key so your system recognizes mongoDBs signed packages and trusts them.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10  

Now add their repository to your sources. If you want to remove this later, just delete the file /etc/apt/sources.list.d/mongodb-org-3.0.list

echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list  

Now install the packages

sudo apt-get update
sudo apt-get install mongodb-org -y

This will result in you installing a shell and server of version 3.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment