Quick connect
Copy your connection string from the dashboard and use it directly:- Python
- Node.js
- Go
- psql
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
sslrootcert=system:
SSL / TLS
All Rivestack connections require SSL. Unencrypted connections are rejected. Usesslmode=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. Withsslmode=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:
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.Connect with psql
Language examples
HA cluster connections
For HA clusters, connections are routed through a load balancer that automatically directs traffic to the primary node. All connections use port6432 — 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
Connection refused
Connection refused
- Verify your host, port, and credentials are correct.
- Ensure you’re using
sslmode=verify-fulland the dashboard hostname, not a raw IP address. - Check that your host and port are correct.
root certificate file ... does not exist
root certificate file ... does not exist
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.SSL errors
SSL errors
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.Too many connections
Too many connections
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.