Hi, I have tried to install mongod from the apt-get install on my Kali Linux machine. However, it couldn’t find a package with that name. Hence, I decided to install mongod binaries specified at in their documentation as follows.
- Donwload mongod package and extract the content
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.17.tgz
- Add the location of mongod in the PATH variable
Goto home directory -> Ctrl+H -> Find the .bashrc file -> open and paste following-> Save
export PATH=<path-to-mongodb-directory>/bin:$PATH
- Create data/db directory. (Since I use the root user not needed to set permissions)
mkdir -p /data/db
- Now open terminal and use mongod to start the server
mongod
- Use mongo command to use the database
mongo
Cheers ! 🙂