Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to Install MongoDB on GoDaddy Server?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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

 

My Personal Notes arrow_drop_up
Last Updated : 03 Jun, 2022
Like Article
Save Article
Similar Reads