Linux Server setup

Install and connect MongoDB Compass

The Compass tool is developed by MongoDB and released free of charge. It can be used to query, aggregate and analyze NoSQL databases. Compass can be downloaded as a standalone program or as part of the MongoDB Community Server software package.

On our server, we have disabled remote access to the MongoDB database, so we connect Compass via SSH.

After the installation we navigate via "Fill in connection fields individually" to enter a new connection (the SSH credentials are based on the previous work of setting up a Linux web server and setting up Databases):

MongoDB Compass
create new connection

Under "Hostname" the default data can be taken over. With me it happened from time to time that the port has changed. The default port is 27017. The data for the SSH tunnel are entered under "More Options":

Hostname data
SSH tunnel data

The connection parameters are:

  • Hostname
    • Hostname: localhost
    • Port: 27017
    • SRV Record: off
    • Authentication: none
  • More Options
    • SSH Tunnel: Use Identity File
    • SSH Hostname: 116.203.69.89 (server IP)
    • SSH Tunnel Port: 22123 (server Port)
    • SSH Username: tom
    • SSH Identity file: "path to private key"
    • SSH Passphrase: *****

The data can be saved via "Favorite":

save connection to favorites
set name and save
saved

With "Connect" the connection is established.

establish connection
connection established