Skip to content

Instantly share code, notes, and snippets.

@sandrabosk
Last active May 1, 2020 14:38
Show Gist options
  • Save sandrabosk/9f1e80db9c230ec8411632ceb412f676 to your computer and use it in GitHub Desktop.
Save sandrabosk/9f1e80db9c230ec8411632ceb412f676 to your computer and use it in GitHub Desktop.

[LIN] Install MongoDB - official docs

Run the following commands in your terminal:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

# FOR VERSION 16.O4 ONLY
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

# FOR VERSION 18.O4 ONLY
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

# NEXT STEPS FOR ALL VERSIONS
sudo apt-get update  #to reload local package database
sudo apt-get install -y mongodb-org  #to install the MongoDB packages

To start MongoDB on your machine:

$ sudo service mongod start

Install MongoDB Compass - official docs

You must download the normal version, not the Community Edition.

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