Skip to content

Instantly share code, notes, and snippets.

@DevSecOpsGuy
Last active September 28, 2019 16:42
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 DevSecOpsGuy/64cd1419467c3f2c4ff022189e04ee23 to your computer and use it in GitHub Desktop.
Save DevSecOpsGuy/64cd1419467c3f2c4ff022189e04ee23 to your computer and use it in GitHub Desktop.
Install MongoDB in Ubuntu 18.04 LTS
#!/bin/bash
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt update
sudo apt install mongodb-org
sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl restart mongod
mongod --version
mongo
> rs.initiate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment