Skip to content

Instantly share code, notes, and snippets.

@douglascabral
Created April 18, 2016 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascabral/d2d1b8777398c47447418fff4a7ab009 to your computer and use it in GitHub Desktop.
Save douglascabral/d2d1b8777398c47447418fff4a7ab009 to your computer and use it in GitHub Desktop.
How to install MongoDB in Ubuntu 15.10
#In terminal execute
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install mongodb-org
#Create /lib/systemd/system/mongodb.service with contents:
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
#Now, you can run:
sudo service mongodb start
sudo service mongodb stop
sudo service mongodb restart
#To edit the configs of Mongo
sudo nano /etc/mongod.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment