Graphical Database Tools
If you prefer to use a graphical interface to manage your databases, you can use tools like pgAdmin or DataGrip in combination with Teleport. These tools can connect to databases through a local port forward established by Teleport Connect or the tsh CLI tool.
We will demonstrate how to set up pgAdmin to connect to a PostgreSQL database managed by Teleport. The steps for other graphical tools like DataGrip are similar.
Prerequisites
- Teleport Connect Client installed on your machine or
tshCLI tool installed. Refer to the Client Installation guide for installation instructions. - pgAdmin installed on your machine. You can download it from the official pgAdmin website.
- A valid Teleport user account with access to the desired database and logged in using either Teleport Connect or
tsh login.
Client Setup
Launch Teleport Connect
Open the Teleport Connect application from your applications menu or desktop shortcut.
Choose desired database connection
Connect to your desired database connection. See General Database Access for more details on connecting to databases using Teleport Connect or tsh CLI.
Note the local port
When you connect to the database using Teleport Connect or tsh, take note of the local port that is being used for the port forward. You will need this information to configure pgAdmin.
Launch pgAdmin
Open the pgAdmin application on your machine.
Add a new server
In pgAdmin, right-click on Servers in the left sidebar and select Create > Server....
Configure server connection
In the Create - Server dialog, enter a name for your server in the General tab. Then, switch to the Connection tab and enter the following details:
- Host name/address:
localhost - Port: The local port you noted earlier from the Teleport Connect or
tshconnection. - Maintenance database: The name of the database you want to connect to.
- Username: Your database username.
- Password: Leave this blank to be prompted for the password when connecting.
Save and connect
Click the Save button to create the server connection. pgAdmin will now connect to the PostgreSQL database through the port forward established by Teleport.