The Teleport Database Service eliminates static database credentials. Instead of sharing usernames and passwords, engineers authenticate through Teleport’s identity-aware proxy and receive short-lived X.509 certificates that expire at the end of their session. Every query, connection attempt, and administrative action is captured in Teleport’s tamper-evident audit log, giving security teams full visibility into who accessed what and when.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/gravitational/teleport/llms.txt
Use this file to discover all available pages before exploring further.
Supported databases
Teleport supports a wide range of self-hosted and managed databases:- Self-Hosted
- AWS Managed
- Azure & Google Cloud
| Database | Protocol |
|---|---|
| PostgreSQL | postgres |
| MySQL / MariaDB | mysql |
| MongoDB | mongodb |
| Redis / Redis Cluster | redis |
| CockroachDB | cockroachdb |
| Microsoft SQL Server | sqlserver |
| Cassandra / ScyllaDB | cassandra |
| ClickHouse | clickhouse |
| Elasticsearch | elasticsearch |
| Oracle Database | oracle |
How the short-lived certificate workflow works
- The engineer runs
tsh db login <db-name>to request a certificate for a database. - Teleport validates their identity, checks their roles, and issues a short-lived client certificate signed by its database CA.
- The Database Service uses that certificate to proxy the connection to the backend database — the engineer never receives raw database credentials.
- When the certificate expires, access is automatically revoked.
Prerequisites
- A running Teleport cluster. See Deploy a Cluster.
- A host (VM or container) where the Teleport Database Service will run with network access to the database.
tctlauthenticated to your Teleport cluster.- The target database with a user account that Teleport can use for certificate-based auth.
Enrolling a PostgreSQL database
The steps below show how to enroll a self-hosted PostgreSQL instance. The same pattern applies to other database types — refer to the database-specific enrollment guides for IAM-based or mTLS variants.Install Teleport on the Database Service host
Install the Teleport binary on the host that will run the Database Service:
Configure the Database Service
Use The generated
teleport db configure create to generate a configuration file:- Teleport Enterprise Cloud
- Self-Hosted
/etc/teleport.yaml will look similar to this:Create a role for database access
Create a role that allows a user to connect to the database as any PostgreSQL user:Assign the role to a Teleport user:
Connecting from GUI tools
For GUI database clients (TablePlus, DBeaver, pgAdmin, DataGrip, etc.), usetsh proxy db to start a local TLS-terminated proxy:
Audit logging
Every database session generates structured audit events that include:- Connection start and end times
- The Teleport user and database user
- Database name and query type
- For supported databases (PostgreSQL, MySQL, MongoDB), individual query text
Next steps
Database RBAC
Restrict which databases, usernames, and schemas each Teleport role can access.
Access Requests
Require just-in-time approval before granting production database access.
Machine Identity
Let CI/CD pipelines and services access databases without static credentials.
tsh Reference
Full reference for tsh db login, tsh db connect, and tsh proxy db.
