Open In App

How to Install MongoDB on GoDaddy Server?

Last Updated : 03 Jun, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

MongoDB is a free, open-source, cross-platform NoSQL database. MongoDB is a schema-less database system and hence it’s very easy to add new fields to it. It is a distributed system hence data recovery is instant and more reliable. Its features include highly flexible, performance, scalability, indexing, cross-platform, load balancing, and inbuilt support for sharding. Under the hood, it uses a JSON-like structure known as BSON for the storage and retrieval of data.

GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, 99% uptime, and much more. It’s a cheaper alternative to some popular cloud-based services such as AWS, GPC, and Azure. Let’s discuss how to install the latest version of MongoDB on a GoDaddy VPS.

Installation of MongoDB on GoDaddy Server

Step 1: ssh into your GoDaddy VPS.

$ ssh user@ip

GoDaddy-VPS

 

Step 2: Before installing mongo, update and upgrade your server.

$ sudo apt update && apt upgrade

Updating-and-upgrading-server

 

Updating-and-upgrading-server

 

Step 3: Import the public GPG key for the latest version of MongoDB. 

$ curl -fsSL https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add –

Importing-public-GPG-key

 

Step 4: After adding the public key, update your server once again then install MongoDB.

$ sudo apt update -y

$ sudo apt install mongodb-org

Updating-server

 

Step 5: Now, run the mongod service by using systemctl command. 

$ sudo systemctl start mongod.service

$ sudo systemctl status mongod

Running-mongod

 

Step 6: Verify the installation process by evoking MongoDB’s internal connection status command.

$ mongo –eval ‘db.runCommand({ connectionStatus: 1 })’

Verifying-installation

 

Step 7: Finally, use the systemctl command to enable the mongod service on the server. Now, mongod will restart whenever the server boots up.

$ sudo systemctl enable mongod

Enabled-mongod

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads