• Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
  • Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
home/Knowledge Base/MySQL and MariaDB/Install MongoDB on CentOS 7
Popular Search:Dedicated Server, CentOS, Web Hosting

Install MongoDB on CentOS 7

20 views 0 December 6, 2019 Updated on December 8, 2019 aklwebhost

MongoDB is one of the leading NoSQL databases that is commonly used in modern web applications. This tutorial will walk you through setting up MongoDB on CentOS 7.

Update System (Optional)

You will want to make sure that your server is up-to-date. If you are setting up your VPS for the first time, it should already be up-to-date. However, if you are running a Custom ISO, or installing on an existing VPS, then you can run the following command to do a system update:

yum update

Install MongoDB

With Yum

CentOS is shipped with MongoDB 2.4.9 (this may change in the future). To install it over yum, run the following command:

yum install mongodb

From MongoDB Repository

If you wish to use the latest version of MongoDB, then you will need to setup the official repository on your server. To do so, create a file in /etc/yum.repos.d/mongodb.repo and populate it with the following data:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

Note: This is for the 64-bit version of CentOS 7. If you have installed the 32-bit version of CentOS 7 using a Custom ISO, you need to change x86_64 to i686.

Once you have saved the file, run the following commands:

yum update
yum install mongodb-org -y

Proceed after the installation has finished.

Setup MongoDB

Start MongoDB by running systemctl start mongod. After the service has started, type mongo into your terminal. If the installation was successful, you will see output similar to the following text.

MongoDB shell version: 2.x.x
connecting to: test
>

Note: Any start-up warnings related to Readahead can be safely ignored. To prevent these warnings, verify that the sectors are “as stated” in the warning by running blockdev –getra /dev/vda1. If the output is greater than 512, run the following commands:

blockdev --setra 512 /dev/vda1
systemctl restart mongod

The warning will now be resolved.

At this point, you are ready to use MongoDB!

Tags:Install MongoDB on CentOS 7

Was this helpful?

Yes  No
Related Articles
  • Setup Spigot Server on Arch Linux
  • How To Install OSSEC HIDS on a CentOS 7 Server
  • Initial Setup of a CentOS 7 Server
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Hot Backups with Percona XtraBackup on the One-Click WordPress App
  • Installing Rust on Ubuntu 14.04
Leave A Comment Cancel reply

MySQL and MariaDB
  • Install MongoDB on CentOS 7
  • Installing InfluxDB on Ubuntu 14
  • Setup NGINX, PHP-FPM, and MariaDB on Debian 8
  • Using MySQL Views on Debian 7
  • Install MariaDB 10 on CentOS 6
  • Install Newer Versions of MongoDB on Debian 7
View All 17  
Popular Articles
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Disabling SSDP (Linux / Windows)
  • Can I pay by Western Union?
  • Can a Coupon Code Discount Be Carried Forward While I Upgrade My VPS Account
  • Can I pay multiple due invoices using a single transaction?
KB Categories
  • Billing
  • Cloud Hosting
  • CMS Hosting
  • cPanel/WHM Control Panel Guide
  • Dedicated Servers
    • AMD Opteron 6272
    • Arch
    • Backup Storage
    • Bandwidth
    • Basic Security
    • BSD
    • CentOS
    • Containers
    • CoreOS
    • DDoS Protection
    • Debian
    • Dedicated Server Control Panel
    • Intel Core i5 3550
    • Intel Core i5 4570
    • Intel Core i7 3770
    • Intel Core i7 4770
    • Intel Xeon E3 1230 V3
    • Intel Xeon E3 1245 V2
    • IP Space
    • Linux Guides
    • Minecraft
    • Networking
    • Server Apps
    • Server Troubleshooting
    • Ubuntu
    • Windows Guides
    • Windows Server 2008
    • Windows Server 2012
  • Domain Names
  • Email Support Documentation
    • Setup IMAP or POP
    • User Features – How To
    • Webmail – How To
  • FTP (File Transfer Protocol
    • CuteFTP Guide
    • FileZilla Guide
  • Game Servers
  • MySQL and MariaDB
  • Node.js
  • Plesk Web Hosting Guide
  • VPS Server
  • Web Servers

  Install MariaDB on CentOS 7

Install ownCloud 7 on CentOS 6 with Nginx w/ SSL, PHP-FPM, and PGSQL (Automated Startup Script)  

  • Privacy Policy
  • Terms of Use
  • © 2022 AKLWEB HOST LLC, All Rights Reserved.

Popular Search:Dedicated Server, CentOS, Web Hosting