Installing MongoDB
Before you can start using MongoDB, you need to install it on your computer. Don't worry – it's simple! You have two options: install MongoDB locally on your machine, or use MongoDB Atlas (cloud version). Let's learn both.
Option 1: Installing MongoDB Locally
Go to the official MongoDB website: MongoDB Community Server
Windows Installation:
- Download the .msi installer for Windows.
- Run the installer and follow the setup wizard.
- Choose "Complete" installation type.
- Make sure "Install MongoDB as a Service" is checked.
- Complete the installation.
Mac Installation (with Homebrew):
brew tap mongodb/brewbrew install mongodb-communitybrew services start mongodb-communityLinux (Ubuntu) Installation:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.listsudo apt-get updatesudo apt-get install -y mongodb-orgsudo systemctl start mongodVerify Installation:
mongod --versionmongo --versionOption 2: MongoDB Atlas (Cloud - Recommended for Beginners)
MongoDB Atlas is a cloud database service. It's free and you don't need to install anything!
- Go to MongoDB Atlas
- Click "Try Free" and sign up.
- Choose the FREE shared cluster (M0).
- Select your cloud provider (AWS, Google Cloud, or Azure) and region.
- Click "Create Cluster" (takes 1-3 minutes).
- Set up database user (username and password).
- Add your IP address to the IP Access List.
- Click "Connect" and get your connection string.
Your Atlas Connection String Looks Like:
mongodb+srv://username:password@cluster0.abcde.mongodb.net/myFirstDatabaseTwo Minute Drill
- You can install MongoDB locally or use MongoDB Atlas (cloud).
- Atlas is easier for beginners – no installation needed.
- Local installation steps vary by operating system.
- After installation, verify with `mongod --version`.
- Save your Atlas connection string – you'll need it to connect.
Need more clarification?
Drop us an email at career@quipoinfotech.com
