Skip to content

Instantly share code, notes, and snippets.

@yamishi13
Last active August 29, 2015 14:09
Show Gist options
  • Save yamishi13/5264bd6097ee562def33 to your computer and use it in GitHub Desktop.
Save yamishi13/5264bd6097ee562def33 to your computer and use it in GitHub Desktop.
MongoDB Ubuntu installer
#!/usr/bin/env bash
# Verify it is not being run as root
if [ $EUID -eq 0 ] ; then
echo "Don't run this script as root if you don't want to have nightmares at night" >> /dev/stderr
exit 1
fi
#add the key for the repo
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
#add the repo
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
#update and install
sudo apt-get update
sudo apt-get install -y mongodb-org
#restart service
sudo service mongod restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment