install latest version of mongodb on ubuntu code example
Example 1: mongodb install in ubuntu
sudo apt update
sudo apt install -y mongodb
sudo systemctl status mongodb
or service mongodb status
sudo systemctl start mongod
or service mongodb start
sudo systemctl stop mongod or
service mongodb stop
Example 2: start mongodb service ubuntu
sudo systemctl start mongod
sudo systemctl stop mongod
Example 3: how to install mongodb in linux
How To Install MongoDB on Ubuntu 18.04 through command line :
Step 1 — Installing MongoDB
$ curl -fsSL https:
$ apt-key list
$ sudo apt update
$ sudo apt install mongodb-org
Step 2 — Starting the MongoDB Service and Testing the Database
Run the following systemctl command to start the MongoDB service:
$ sudo systemctl start mongod.service
$ sudo systemctl status mongod
$ sudo systemctl enable mongod
$ mongo --eval 'db.runCommand({ connectionStatus: 1 })'
Example 4: mongodb install ubuntu
follow the steps from the below link
https:
Example 5: how to install mongodb database in ubuntu version
> sudo apt-key adv --keyserver hkp: