Skip to main content

Add Remote MongoDB Server

To add a remote MongoDB Server

You can add unlimited  number of remote  MongoDB servers to your Eenos hosting control panel.

MongoDB -> Add MongoDB Server

We recommend to add a MongoDB  v4.4 or higher compatible version of remote  database servers

Add A New Server

To add a new server you need to fill out the following,

  • Remote Host : The remote MongoDB server IP or Host Name to connect.
  • Remote MongoDB  User :  The user name to authenticate to the remote  server.
  • Remote User Password : The remote MongoDB  user password.

Please  make sure the remote user have admin privileges on remote server , so that the user can create  other users and  databases

You may need to white list the remote server IP in firewall and open the MongoDB  port 27017

How to grant remote user privilege ?

Enabling remote access to MongoDB is easy.  Please follow the steps below,

Configure the Public bindIP

You need to edit the mongodb server configuration file /etc/mongod.conf and make changes to the filed bindIp as follows,

net:
  bindIp: 0.0.0.0,::0
  port: 27017

This will allow mongoDB server to listen on all the IP address. If you like to listen on only one IP , you need to enter the IP instead of 0.0.0.0

Restart mongoDB server

You need to restart the MongoDB server to apply the changes.

sudo systemctl restart mongod

After completing these steps, you should be able to connect to the MongoDB server from a remote machine using a mongo client. However, please note that allowing remote access to a MongoDB server can bear a security risk, so it is recommended to use secure passwords, encryption, and firewall rules to protect your system.

Please use a strong complicated password for the remote MongoDB user.