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 ! 🙂
Pingback: Use MongoDB Cloud with Python on Kali 2020 | Tech Star
dear kulani, tkns for this article :),
I’m having an issue in finding the mongodb directory to add to path.
I’m on Kali 2020 as you.
can you please tell me how to find it on debian based distro?.
I’m using “locate ” but still get a mess of files
tanks a lot
LikeLike
@emixstream not sure if you still need it, refers to the path you downloaded and untar-ed the mongo files.
Say that you have un-tar the file in /home/kali/Desktop, your path would be /home/kali/Desktop/mongodb-linux-x86_64-3.6.17
Here’s an example:
[/home/kali/Desktop] # tar -xvf mongodb-linux-x86_64-3.6.17.tgz
[/home/kali/Desktop] # export PATH=/home/kali/Desktop/mongodb-linux-x86_64-3.6.17/bin:$PATH
LikeLike