Goal
In this tutorial, we’ll explain how to connect the Platform.sh MongoDB using SSH tunnel with a MongoDB GUI such as Robo 3T
Preparation
This tutorial assumes you have
- A working project with MongoDB service, e.g; spring-mvc-maven-mongodb
- An installed Robot 3T
- Platform.sh CLI
Problems
The simplest way to run a project locally is to use a tethered development environment - that means running a local web server, but keeping all other services on Platform.sh and connecting to them over an SSH tunnel. Furthermore, you can check the production data using a GUI interface such as Robot 3T.
Steps
-
Download the project using the platform-cli
-
platform get <PROJECT_ID>
-
Go into the project folder:
-
cd PROJECT_NAME
-
Open the SSH tunnel with the following command:
-
platform tunnel:open
4. Based on the tunnel output information, that is time to create a new connection from Platform.sh tunnel.
5. The last step is to check the connection using the “Test” button.
6. Done, you can save and use this connection while the tunnel is open.