Install MongoDB CLI Client on Kali Linux

Time to show you how to install and access MongoDB instances! In case you find some interesting ones you want to peek at.

sudo apt-get install gnupg

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -

echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

sudo apt-get update

sudo apt-get install -y mongodb-org

Now you have MongoDB and it’s tools installed! We are just going to use MongoSH which is a CLI client to connect to MongoDB instances.

mongosh "mongodb://IP:27017"

show databases

use ‘database-name’

show collections

db.’collection’.stats()

db.’collection’.findOne()

db.’collection’.find().prettyPrint()

db.’collection’.find()

Leave a Reply