PRE-ORDER

Dedicated Servers at Equinix London LD6

Inquire Today
How To Install MongoDB (5.0) in Ubuntu 20.04 / 18.04 Server

How To Install MongoDB (5.0) in Ubuntu 20.04 / 18.04 Server

NetShop ISP

NetShop ISP · Blog Author

Jun 03, 2022 · Tutorials

MongoDB is one of the popular NoSQL database server used in developing modern dynamic apps. It makes use of JSON-like documents and optional schemas; data objects stored as separate documents within a collection, as opposed to rows and columns used in traditional relational databases. MongoDB is highly scalable and flexible and offers easy querying and indexing for developers. Due to its horizontal scaling and load-balancing capabilities, MongoDB has offered developers highest levels of flexibility and scalability. MongoDB Atlas is a cloud database service and is the leading for developing modern applications and can deploy fully managed cloud databases across Azure, AWS or Google Cloud.

MongoDB offers both a community Edition which is free to download and use and an Enterprise Edition which is part of the MongoDB Enterprise Advanced subscription. This Enterprise version includes comprehensive support for your MongoDB deployment and offers enterprise-focused features such as LDAP and Kerberos support, on-disk encryption, and auditing.

In this article we demonstrate the steps which will help you to successfully install MongoDB 5.0 on your Ubuntu 20.04/18.04 Server.

Step 1: Install necessary packages

sudo apt update
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release

Step 2: Import MongoDB GPG Key

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -

or, alternatively, use this command:

curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/mongodb.gpg

Step 3: Add MongoDB Repository on Ubuntu 20.04 / 18.04

Ubuntu 20.04:

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $( lsb_release -cs)/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

Ubuntu 18.04:

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

Step 4: Install MongoDB on Ubuntu 20.04 / 18.04

sudo apt update
sudo apt install mongodb-org
sudo apt-get install -y mongodb-org=<version> mongodb-org-database=<version> mongodb-org-server=<version> mongodb-org-shell=<version> mongodb-org-mongos=<version> mongodb-org-tools=<version>

Make sure you replace <version> with the specific version of MongoDB you wish to install.

Step 5: Start MongoDB 5.0

Once the installation process is complete, proceed to start and enable MongoDB using the following commands:

sudo systemctl start mongod
sudo systemctl enable mongod

Important: Enable Password Authentication

Let’s enable mongodb password authentication so that users can login with a password to read or edit database.

Edit the file /etc/mongod.conf and uncomment #Security and the add the content to be as below:

security:
  authorization: enabled

Then, restart the Mongod service:

sudo systemctl restart mongod

That’s it! For advanced configuration, security hardening or further management of your MongoDB please contact our Support team by submitting a ticket from within the myNetShop portal.

For a fully managed Mongo database service we offer a dedicated Database administration team. Please contact sales at netshop-isp.com.cy for more information.

Related Articles

Categories

Backup
6
Business Continuity
4
Cloud Hosting
9
Colocation
4
Company Updates
1
Cryptocurrencies
1
Data Centers
12
Dedicated Servers
4
Disaster Recovery
3
Forex
24
Gaming
1
iGaming
33
Industry News
31
Interviews
8
Joomla
9
Magento
5
Managed Services
1
Press Releases
58
Product News
6
Resellers
1
Security
24
Software & Apps
1
Streaming
1
Tech Startups
12
Tutorials
51
Uncategorized
389
Vps Hosting
11
Web Design & Development
3
Web Hosting
43
Webinars
1
Wordpress
14

Free VPS Trial

No Credit Card Required.

Recent Posts

How To Install Node.js and NPM on Debian 11 server

How To Install Node.js and NPM on Debian 11 server

27 November, 2022

NetShop ISP CEO Shortlisted at Fazzaco Hall of Fame 2022

NetShop ISP CEO Shortlisted at Fazzaco Hall of Fame 2022

21 November, 2022

How To Install MariaDB 10.5, Apache 2.4, PHP 7.4 (LAMP) on Debian 11 Server

How To Install MariaDB 10.5, Apache 2.4, PHP 7.4 (LAMP) on Debian 11 Server

09 November, 2022

NetShop ISP Expand in Two New Region Hubs

NetShop ISP Expand in Two New Region Hubs

08 November, 2022

How To Resolve Acronis Agent error related to “snumbd26” kernel module on Linux Plesk/cPanel Servers

How To Resolve Acronis Agent error related to “snumbd26” kernel module on Linux Plesk/cPanel Servers

07 November, 2022

Products

Bare Metal Dedicated Servers

Virtual Servers (VPS / VDS)

Rack Space & Colocation Hosting

Fast Web Hosting

Cloud Backup

Premium DNS Hosting

Resources

Blog

Videos

Events

APIConnect

WhitepapersNew

Looking Glass

Company

About Us

CareersNew

Awards & Honours

Become a Partner

Contact Us

#letushostyou

Award Winning Hosting Provider with a Customer-centric approach to Business and an Open Source Mindset regarding Solutions and Products Development.

Est. 2004, Larnaca – Cyprus


About

Legal Address: 2A, Marathonos, Livadhia, 7060, Cyprus

Operations Office: 120, Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca, 6031, Cyprus

Company Reg: HE 217340
EU VAT Number: CY10217340J
ISO 9001:2015: No. QS.21.038

International Phone: +357 2425 0808