Skip to content

Instantly share code, notes, and snippets.

@ayarushin
Created September 19, 2016 17:40
Show Gist options
  • Save ayarushin/40d54ee040ef826a20226ba4352773f2 to your computer and use it in GitHub Desktop.
Save ayarushin/40d54ee040ef826a20226ba4352773f2 to your computer and use it in GitHub Desktop.
Install MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/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 -y mongodb-org
sudo bash -c " cat > /etc/systemd/system/mongodb.service <<EOF
[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
EOF"
systemctl start mongodb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment