How to install MongoDB 6 on Ubuntu 22.04 LTS Linux
Summary
TLDRThis tutorial video guides viewers through installing MongoDB on Ubuntu 22.04. It begins with downloading the MongoDB Community Server from the official website, followed by installation using the terminal. The video then demonstrates starting the MongoDB service and checking its status. Additionally, it covers installing MongoDB Shell for command-line access and MongoDB Compass for a graphical user interface. The tutorial concludes with basic operations like creating databases and collections and inserting data, showcasing the ease of working with MongoDB on Ubuntu.
Takeaways
- 🌐 Start by opening a browser and searching for 'download MongoDB' from the official website.
- 🔗 Click on the 'MongoDB Community Server Download' link to access the download page.
- 📚 Choose the latest version of MongoDB Community Server available for download at the time of the video.
- 🖥️ Select the appropriate platform, specifically Ubuntu 22.04, to download the server package.
- 📥 Download the .deb file for MongoDB server, which is not a large file and should download quickly.
- 📁 Navigate to the Downloads folder to locate the downloaded MongoDB server .deb file.
- 💻 Use the terminal to execute the .deb file with the command 'sudo dpkg -i' followed by the file name.
- 🔓 Provide your Ubuntu password when prompted to initiate the installation of MongoDB.
- 🛠️ After installation, use 'systemctl' commands to check the status and start the MongoDB service.
- 🔄 Ensure MongoDB service is active and running by checking its status with 'systemctl status mongod'.
- 🛠️ Install MongoDB shell and MongoDB Compass, both available as .deb files from the official website.
- 📝 Use the MongoDB shell to connect to the server and perform operations like creating databases and collections.
- 🖼️ MongoDB Compass is a GUI client that allows for visual interaction with MongoDB, including database and collection management.
Q & A
What is the purpose of the video?
-The purpose of the video is to demonstrate how to install MongoDB on an Ubuntu operating system.
Where can I find the MongoDB Community Server download link?
-You can find the MongoDB Community Server download link on the official MongoDB website, mongodb.com, by searching for 'download MongoDB'.
What is the current version of MongoDB mentioned in the video?
-The current version of MongoDB mentioned in the video is 6.0.5.
Which platform is the video focused on for downloading MongoDB?
-The video is focused on downloading MongoDB for Ubuntu 22.04.
What file format is downloaded for the MongoDB installation?
-The MongoDB installation file is downloaded as a .deb file.
How do you navigate to the downloads folder in the terminal?
-You navigate to the downloads folder in the terminal by typing 'cd Downloads' and pressing enter.
What command is used to install the MongoDB .deb file?
-The command used to install the MongoDB .deb file is 'sudo dpkg -i' followed by the file name.
How can you check the status of the MongoDB service after installation?
-You can check the status of the MongoDB service by using the command 'sudo systemctl status mongod'.
What command is used to start the MongoDB service?
-The command used to start the MongoDB service is 'sudo systemctl start mongod'.
Where can you find MongoDB Shell and MongoDB Compass for download?
-You can find MongoDB Shell and MongoDB Compass for download on the MongoDB website under the 'Products' and then 'Community Edition' section.
How do you connect to the MongoDB server using the shell?
-You connect to the MongoDB server using the shell by typing 'mongo' in the terminal, which should automatically connect to the default MongoDB server running on localhost.
What is the procedure for installing MongoDB Compass?
-The procedure for installing MongoDB Compass is similar to installing the MongoDB server: download the .deb file, navigate to the downloads folder, and use the command 'sudo dpkg -i' followed by the file name.
How can you view your MongoDB data using a graphical user interface?
-You can view your MongoDB data using a graphical user interface by installing and opening MongoDB Compass, then connecting to your local MongoDB server.
Outlines
💻 Installing MongoDB on Ubuntu
This paragraph provides a step-by-step guide on how to install MongoDB on an Ubuntu operating system. It begins with the process of downloading the MongoDB Community Server from the official website, selecting the appropriate version and platform. The user is then guided to execute the downloaded .deb file using terminal commands, including navigating to the downloads folder and using 'sudo dpkg -i' to install the server. After installation, the status of the MongoDB service is checked and the service is started using 'systemctl' commands. The paragraph concludes with a brief mention of checking the MongoDB service status to confirm it is running.
🔍 Exploring MongoDB Shell and Compass
The second paragraph delves into connecting to the MongoDB server and interacting with it. It introduces the MongoDB shell, a command-line interface, and MongoDB Compass, a graphical user interface. The user is guided to download and install both the shell and Compass from the MongoDB website, detailing the selection process for the appropriate version and platform. The paragraph explains how to use the shell to connect to the server, list databases, create a new database, and insert data into a collection. It also covers the installation and basic usage of MongoDB Compass, including connecting to the server, viewing databases and collections, and creating new collections.
🛠️ Advanced MongoDB Compass Usage
The final paragraph focuses on advanced features of MongoDB Compass, such as creating databases and collections with ease. It describes the process of installing MongoDB Compass from the official website, including selecting the stable version and the appropriate package format for the user's operating system. The installation process is similar to that of the MongoDB shell, using terminal commands. Once installed, the paragraph explains how to launch MongoDB Compass, connect to the MongoDB server, and interact with the databases and collections. It also demonstrates how to create a new collection and mentions the introduction of time series collections in MongoDB 5, concluding with the creation of a new database using the Compass interface.
Mindmap
Keywords
💡MongoDB
💡Ubuntu
💡.deb file
💡Terminal
💡Systemctl
💡MongoDB Shell
💡MongoDB Compass
💡Database
💡Collection
💡Document
💡Time Series Collection
Highlights
Introduction to installing MongoDB on Ubuntu.
Opening a browser to download MongoDB from the official website.
Selecting the MongoDB Community Server for download.
Choosing the latest version of MongoDB Community Server.
Selecting the appropriate platform and package type for Ubuntu 22.04.
Downloading the .deb file for MongoDB server.
Accessing the downloaded file in the Downloads folder.
Executing the .deb file using terminal commands.
Providing Ubuntu password to initiate MongoDB installation.
Checking the status of the MongoDB service after installation.
Starting the MongoDB service using systemctl.
Verifying the active status of the MongoDB service.
Exploring the MongoDB shell and Compass as client utilities.
Downloading the MongoDB shell for command line operations.
Installing the MongoDB shell using dpkg.
Using the shell to connect to and interact with MongoDB server.
Demonstrating database and collection creation within the shell.
Installing MongoDB Compass for graphical user interface access.
Using MongoDB Compass to connect to, view, and manage databases.
Creating additional collections and databases with MongoDB Compass.
Conclusion summarizing the installation process and utility options.
Transcripts
hey guys in this video I'm going to show
you how you can install
mongodb on your Ubuntu operating system
so let's get started and let's see how
we can do it
so first of all open your browser and
search for download mongodb
and the first link which will appear
here will be from mongodb.com
and here you can see mongodb Community
server download
link right so we want to download the
community server for mongodb so just
click on this link
which is going to open this website so
once you are on this mongodb Community
Edition web page you can scroll down a
little and you will see mongodb
Community server download
I'm going to scroll down and here you
will be able to see the version
so you can download the latest version
from here the current version at the
time of making this video is
6.0.5 so select that version and then
select the platform you want to download
the mongodb for our Ubuntu
22.04 so I'm going to select Ubuntu
222.04 here
and then the package is server right so
we want to download the mongodb server
just click on download
which is going to download this
mongodb.deb file so just wait for the
download to complete it's not a big file
so it will be downloaded really fast so
you can see this file is downloaded
now in order to view that file you can
go to the files and then click on
downloads and here you can see this
mongodb server
amd64.deb file right so how you can
execute this file in order to execute
this file you can use your terminal so
just click on show applications icon
here and then open your terminal by
selecting the terminal icon or you can
search for terminal here and then open
the terminal from here
and then navigate to your downloads
folder by just typing CD
downloads and then press enter and now
you are in your downloads folder right
so in order to uh run this file let me
just LS in this directory so you can see
all the files in that downloads folder
directory and we want to execute this
file which is dot Deb file right so I
can run this dot the EB file using this
command just write sudo
dpkg hyphen I and the name of your file
so you can just write M and then press
tab it's going to auto complete the file
name right so you can just write mongodb
and then press Tab Key on your keyboard
and your file name will be Auto
completed and then press enter and give
your ubuntu's password so I'm going to
provide my ubuntu's password and then
press enter
and it's going to start the installation
of mongodb
so now mongodb has been installed on our
Ubuntu operating system
so let's see the status of mongodben if
it's running after installing a mongodb
so when you install mongodb you need to
start the mongodb service in order to
start the mongodb server right so in
order to check the status of the mongodb
service let's see what's the command for
that so to check the status just write
sudo and then system CTL so just write
the system
CTL
status and then the name of your service
in our case the name of our service will
be d right so just press enter
here and you can see that mongodb
database server is there but right now
it's inactive or dead right so we need
to start this service so in order to
start this service you need to write
this command sudo systemctl
start and then D and then press
enter which is going to start the
Daemon on your Ubuntu operating system
once again you're going to check the
status of our Daemon service and
this time you will see that the status
is active or running after we started
this mongodb right so now we have
successfully installed mongodb server
but how you can connect to the server
and create some databases or view the
data inside your database for that you
will need a utility called sh if
you want to use the command line tool or
you can also download some kind of
graphical user interface client also
which is also available on mongodb
website
so you can once again go to the mongodb
website where you have downloaded the
community version here you can select
products and then Select Community
Edition
and then when you scroll down
you have already downloaded the mongodb
server and then when you scroll down a
little you will see tools right
so under Tools you can see mongodb shell
you also have mongodb Compass which is
the mongodb client which is the
graphical user interface client so let's
try to install both of these clients the
command line client and the graphical
user interface so let's install the
mongodb shell first so I'm going to
select mongodb shell select the latest
version from here and then platform is
Ubuntu so this is okay for me
and then the package type is dot dep
just click on download which is going to
start download and you know the
procedure so once this dot the EB file
is downloaded we are going to go to our
downloads folder so let me clear this
terminal and I'm already in my downloads
folder if you are not you can just see
the two your downloads folder and you
can see this sh
dot Deb file is downloaded so the
command for installing is same just
write sudo
dpkg hyphen I and the name of your
mongodb
dot the EB file so just right click copy
and right click paste here and then
press enter which is going to start the
download of sh or shell
just wait for some time and you can see
shell is also installed
once it's installed you can write this
command which is sh to check the
status so just write sh
and if
everything is working fine then this
sh command is going to connect to
your default mongodb server which is
running on your Local Host right so we
have already uh installed mongodb server
and it's it was already running
so this client has recognized that and
connected to your default mongodb server
here you can write some commands like
show DBS
and it's going to show all the databases
right if you want to create a database
you can write use
and the name of your database for
example my DB and it's going to create
that database for you
but
you need to insert some data in your
database
to view this database when you give this
show DBS command so if you give show DBS
you will not be able to see this command
I should have written show
the bees here
and you can see still I don't see my DB
in the list
the reason is I have to insert some data
into my database in order to view that
database
so in order to create a collection you
can write this command DB dot create
collection right so I just need to write
db.38 collection and then in the
parenthesis just give the name of your
collection I'm going to name my
collection as
students for example and then press
enter
now in order to view the collections
inside my database I can say show
collections here and you can see I have
one collection which is students
collection right
in order to insert data I can write DB
dot The Collection name which is
students in my case and then insert and
then I can give adjacent value to insert
data into it I can so I can insert the
data using these curly brackets and then
I can say name
colon
whatever name I want to give here right
so just insert the data using this
command
and once the data is inserted you can
see when you give show DBS command you
will be able to see my DB is there right
so shell is working let's also
install mongodb compass
so once again go to the mongodb website
and then click on product click on
Community Edition
and then under Tools
you will be able to see this mongodb
Compass here mongodb Compass which is a
GUI I'm going to click on that and then
here I can select the stable version and
then select my operating system which is
Ubuntu 64-bit and then I can select this
package format which is dot dep right
so just click on this download button
which is going to download this mongodb
Compass dot Deb file once this dot Deb
file is downloaded the procedure for
installing mongodb Compass is also very
easy just CD to your downloads folder
just give LS command to view what is the
name of the mongodb compass dot the EB
file you can see this is the file which
we have downloaded
in order to run this just write sudo
dpkg
hyphen I and the name of your file which
is this one so I'm going to right click
copy and right click paste and then
press enter and give my ubuntu's
password
and then press enter which is going to
install mongodb compass on my Ubuntu
operating system once mongodb Compass is
installed
you can see I can use this command which
is mongodb hyphen Compass or I can go to
uh the application section so just click
on show applications
and here I can see this mongodb Compass
uh icon I can also search for
mongodb and you can see mongodb
compasses here so just open mongodb
compass
uh using this uh icon
and once mongodb Compass has been
started
you just need to connect to your
database so the default mongodb server
is running on localhost
27017 Port just click on connect
and you will be able to see all your
databases you can see we have created
mydb database and one collection here
and our collection is there and we have
just inserted one document inside our
collection which was the name and it's
there right
so this is how you can view your mongodb
data using this graphical user interface
also from here you can also create the
databases and collections
so let me create one more collection
which will be called let's say analytics
and the
collection name will be let's say sensor
right and then from mongodb 5 you can
also Define what type of collection you
want so so from mongodb 5 onwards you
can also create time series collection
we don't want to create time series
collection for now I'm going to just
click on create database
and you can see this database is created
okay
so this is how you can download and
install mongodb server mongodb shell and
mongodb compass on your Ubuntu operating
system I hope you've enjoyed this video
and I will see you in the next video
Ver Más Videos Relacionados
5.0 / 5 (0 votes)