1. Navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&connectTab=direct&method=session). These steps use the Session pooler (port `5432`), which works from IPv4-only networks. Use the direct connection string instead if you're in an [IPv6 environment](/kb/troubleshooting/supabase--your-network-ipv4-and-ipv6-compatibility-cHe3BP) or have the [IPv4 add-on](/docs/guides/platform/ipv4-address). For serverless or edge functions, use the Transaction pooler (port `6543`) and turn off prepared statements, which it doesn't support. See [Which connection method do you use?](/docs/guides/database/connecting-to-postgres#choose-a-connection-method). 1. Look for the **Session pooler** connection string and copy it. Replace the password placeholder with your saved database password, and [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) any reserved characters it contains, such as `&`, `#`, `?`, or a space. If you don't have your database password, you can reset it in your [Database Settings](/dashboard/project/_/database/settings). 1. Set `sslmode=require` either on the connection string itself or as an explicit config option if your framework sets it separately. Most drivers default to `prefer`, which falls back to sending your data in plaintext if the encrypted attempt fails. You can also [enforce SSL](/docs/guides/platform/ssl-enforcement) on the database side. The connection strings below show the format only. Take the host, port, and username from the string you copied rather than typing the bracketed placeholders literally.