Skip to main content

Quick connect

Copy your connection string from the dashboard and use it directly:
The Python and psql examples carry sslrootcert=system because libpq does not read your operating system’s trust store on its own. Leave it out and the connection fails with root certificate file "~/.postgresql/root.crt" does not exist. See SSL / TLS for the detail and for what to use on libpq older than 16.

Connection details

Find your connection credentials in the Rivestack dashboard under the Connection tab of your database or cluster.
Port 6432 applies to every dedicated plan — Solo, Starter, Growth and Scale — on a single node and after scaling to HA alike. Free shared databases use 5432. Copying the connection string from the dashboard always gives you the right one.

Connection string

For psql and the Python drivers, add sslrootcert=system:
Click the copy button next to each field in the dashboard to copy values to your clipboard.

SSL / TLS

All Rivestack connections require SSL. Unencrypted connections are rejected. Use sslmode=verify-full so the client also verifies the CA chain and confirms that the certificate matches the database hostname. sslmode=require encrypts traffic but does not authenticate the server identity. There is no CA certificate to download. Rivestack certificates are issued by Let’s Encrypt, which every operating system already trusts.

Point libpq at your system’s trusted roots

psql and the Python drivers are built on libpq, and libpq does not read your operating system’s trust store on its own. With sslmode=verify-full it looks for a file at ~/.postgresql/root.crt, and on most machines that file does not exist, so the connection fails before it reaches the server:
Add sslrootcert=system to tell libpq to use the roots your system already trusts:
sslrootcert=system requires libpq 16 or newer. On older clients, give it the path to your system bundle instead: /etc/ssl/certs/ca-certificates.crt on Debian and Ubuntu, /etc/pki/tls/certs/ca-bundle.crt on RHEL and Fedora.
Node.js, Go and Java drivers do not need this parameter. They use their own TLS stacks, which trust the system roots by default.

Connect with psql

You’ll be prompted for your password. To include it inline:

Language examples

Using psycopg2

Using SQLAlchemy

HA cluster connections

For HA clusters, connections are routed through a load balancer that automatically directs traffic to the primary node. All connections use port 6432 — the same port a single-node cluster uses. Scaling up to HA adds the load balancer without changing your connection string: the hostname and port both stay as they were. The load balancer handles failover automatically, and your application reconnects to the new primary without changing connection details.

Connection limits

Dedicated plans connect through PgBouncer in transaction-pooling mode: the first number is how many client connections the pooled endpoint accepts, the second how many transactions execute on PostgreSQL at once per database. Clients beyond the slot count wait briefly instead of failing.

Troubleshooting

  • Verify your host, port, and credentials are correct.
  • Ensure you’re using sslmode=verify-full and the dashboard hostname, not a raw IP address.
  • Check that your host and port are correct.
psql and the Python drivers use libpq, which does not read your operating system’s trust store on its own. Add sslrootcert=system to the connection string so it uses the roots your system already trusts. On libpq older than 16, give it the path to your system bundle instead, such as /etc/ssl/certs/ca-certificates.crt. There is no CA file to download from us. See SSL / TLS.
All connections require SSL. Configure sslmode=verify-full and connect with the hostname shown in the dashboard, not a raw IP address, since verify-full checks the hostname against the certificate. Rivestack certificates are issued by Let’s Encrypt, so there is no custom CA to download.
Free databases allow 15 direct connections. Dedicated plans accept 500 to 10,000 pooled client connections depending on server type, with 20 to 40 transaction slots per database; extra clients queue briefly rather than failing. See the connection limits table above.