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 check the version of MongoDB?
- How to work with time series data in MongoDB?
- How to update many documents in MongoDB?
- How to update an array element in MongoDB?
- How to use triggers in MongoDB?
- How to use unwind in MongoDB?
- How to list MongoDB users?
- How to remove a field from MongoDB?
- How to use MongoDB queue?
See more codes...