Skip to content

Instantly share code, notes, and snippets.

@kazi331
Created December 31, 2023 18:39
Show Gist options
  • Save kazi331/d0429360583cc9badb4c68ce75602748 to your computer and use it in GitHub Desktop.
Save kazi331/d0429360583cc9badb4c68ce75602748 to your computer and use it in GitHub Desktop.
mongodb isntallation step by step procedure

installation of mongodb server and compass : https://www.mongodb.com/docs/mongodb-shell/install/

step 1: import the public key used by the package management system

wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-7.0.asc

If you receive an error indicating that gnupg is not installed, perform the following steps:

sudo apt install gnupg 

retry importing key

wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-7.0.asc

step 2: create a list file for MongoDB

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

step 3: reload local package database

sudo apt update

step 4 : install packages

sudo apt install mongodb-compass mongodb-org-server 

step 5: start mongodb server

sudo systemctl start mongod

check status

sudo systemctl status mongod

enable mongodb server

sudo systemctl enable mongod

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