Skip to main content

Add Remote MongoDB Server

To add a remote PgSQLMongoDB Server

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

PostgreSQLMongoDB -> Add Remote PgSQLMongoDB Server

We recommend to add a PgSQLMongoDB 13 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 PgSQLMongoDB server IP or Host Name to connect.
  • Remote PgSQLMongoDB  User :  The user name to authenticate to the remote  server.
  • Remote User Password : The remote pgsqlMongoDB  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 PgSQLMongoDB outgoing port 543227017

How to grant remote user privilege ?

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

 ModifyConfigure the PostgreSQLPublic configuration filebindIP

OpenYou need to edit the PostgreSQLmongodb server configuration file “postgresql.conf” using your preferred text editor. 

Example :  /etc/postgresql/13/main/postgresql.mongod.conf

Then,and findmake changes to the linefiled #listen_addressesbindIp =as 'localhost' and uncomment it (remove the # character at the beginning of the line).follows,

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

Next, change the value of “listen_addresses” to “*”. This allowswill PostgreSQLallow mongoDB server to listen on all availablethe IP addresses.address. Alternatively,If you canlike specifyto alisten specificon only one IP address, oryou aneed rangeto ofenter the IP addressesinstead that are allowed to connect to the server.

Modify the pg_hba.conf file

Open the “pg_hba.conf” file using your preferred text editor. 

Example :  /etc/postgresql/13/main/pg_hba.conf

Take the following section:

# IPv4 local connections: 
host    all             all             127.0.0.1/32            md5 

And modify it this way: 

# IPv4 local connections:
host    all             allof 0.0.0.0/0            md5 

Restart PostgreSQLmongoDB server

RunYou the following commandneed to restart PostgreSQL:the MongoDB server to apply the changes.

sudo service postgresqlsystemctl restart mongod

After completing these steps, you should be able to connect to the PostgreSQLMongoDB server from a remote machine using a PostgreSQLmongo client. However, please note that allowing remote access to a PostgreSQLMongoDB 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 PgSQLMongoDB user.