---
title: "Configure PostgreSQL data source connection details | Grafana Labs"
description: "Learn how to enter the connection details, credentials, and TLS/SSL mode for the PostgreSQL data source."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Configure PostgreSQL data source connection details

In this milestone, you configure the connection details and authentication credentials so that Grafana Cloud can connect to your PostgreSQL database.

This includes the host and port, the database name, the user name and password, and the TLS/SSL mode.

1. In the **Host URL** field under the **Connection** section, enter the hostname or IP address and port of your PostgreSQL server.
   
   For example, enter `localhost:5432` or `postgres.example.com:5432`. The default PostgreSQL port is `5432`.
2. In the **Database name** field, enter the name of your PostgreSQL database.
   
   For example, enter `grafana`. This database is used as the default for queries in the query editor.
3. In the **Username** field under the **Authentication** section, enter the name of the PostgreSQL user you created.
   
   For example, enter `grafanareader`.
4. In the **Password** field, enter the password for the PostgreSQL user you created.

Next, set the **TLS/SSL Mode** to match your database. For cloud-hosted databases such as Amazon RDS, Azure Database for PostgreSQL, and Google Cloud SQL, `require` is the recommended minimum. Use `verify-full` for the most secure option, or `disable` only for local development on a trusted network.

In the next milestone, you’ll select the private data source connect (PDC) agent and test the connection.

* * *

### More to explore (optional)

- [PostgreSQL configuration options](/docs/grafana/latest/datasources/postgres/configure/#postgresql-configuration-options)
- [TLS/SSL mode reference](/docs/grafana/latest/datasources/postgres/configure/#tlsssl-mode-reference)
- [Private data source connect (PDC)](/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/)
