Skip to content

Instantly share code, notes, and snippets.

@CharlesNepote
Last active April 14, 2022 11:33
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 CharlesNepote/13198c2ed336fc64cb674d63876e8d99 to your computer and use it in GitHub Desktop.
Save CharlesNepote/13198c2ed336fc64cb674d63876e8d99 to your computer and use it in GitHub Desktop.
# MongoDB installation on Debian 10 or Debian 11
apt update
apt upgrade -y
apt install gnupg
# Install libcurl3 from Debian 9 Stretch because Debian 10 only provide libcurl4
echo "deb http://deb.debian.org/debian/ stretch main" | sudo tee /etc/apt/sources.list.d/debian-stretch.list
apt update
apt install libcurl3
# Install MongoDB 4.4
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
apt update
apt install -y mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
# Test
mongo --version # should answer "MongoDB shell version v4.4.3 [...]"
# sudo systemctl enable mongod --now # start the DB
# mongo --eval 'db.runCommand({ connectionStatus: 1 })' # to verify mongo is running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment