Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 1022 Bytes

how-to-install-mongodb-on-ubuntu.md

File metadata and controls

35 lines (30 loc) · 1022 Bytes

How to install MongoDB on Ubuntu?

// plain

  1. 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
  1. Update the packages list and install the MongoDB package:
sudo apt-get update
sudo apt-get install -y mongodb-org
  1. Start MongoDB:
sudo service mongod start
  1. Check the status of MongoDB:
sudo service mongod status
  1. You can now connect to MongoDB using the mongo shell:
mongo

Helpful links

group: install

onelinerhub: How to install MongoDB on Ubuntu?