mongodbHow to install MongoDB on Ubuntu?
- Install MongoDB on Ubuntu using the official MongoDB repository:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
- Update the packages list and install the MongoDB package:
sudo apt-get update
sudo apt-get install -y mongodb-org
- Start MongoDB:
sudo service mongod start
- Check the status of MongoDB:
sudo service mongod status
- You can now connect to MongoDB using the mongo shell:
mongo
Helpful links
Related
More of Mongodb
- How to use watch in MongoDB?
- How to use Docker Compose with MongoDB?
- How to update many documents in MongoDB?
- How to update one document in MongoDB?
- How to drop a database in MongoDB?
- How to check the version of MongoDB?
- How to empty an array in MongoDB?
- How to work with time series data in MongoDB?
- How to use unwind in MongoDB?
- How to sort MongoDB query results?
See more codes...