For Linux users:
- curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -- dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg
The above command will download the gpg key from mongodb official site.
- echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
This line adds MongoDB’s official repository to Debian and ties it to the trusted GPG key.
Without it → APT won’t know where to fetch MongoDB packages.
sudo apt install mongodb-org
APT downloads MongoDB packages from their servers.
The GPG key ensures that the package is officially from mongodb server.sudo start systemctl mongod
sudo enable systemctl mongod
So after doing both, MongoDB is running now and will always run on boot.mongod --version
shows version of mongodb which helps us to ensure the installation of mongodbmongosh
this command helps you to launch CLI of mongodbnow go to mongodb atlas and create an account for that.
it will load sample dataset, next click the connect button
choose shell here
Top comments (0)