PostgreSQL setup

How to connect a PostgreSQL database. You add the connection from Settings → Connections → New Connection.

What you need

Name
A label so you can recognise the connection.
Driver
Choose Postgres.
Host & Port
Your database host and port (PostgreSQL defaults to 5432).
Database
The database name to connect to.
User & Password
Credentials STYD will use — prefer a read-only user.
Schema
The schema to use (defaults to public). Use the refresh button to load schemas from the database.

Steps

Open Settings → Connections, choose Add a connection, then A database.
Select PostgreSQL as the database type and enter the server address, port, database, user, and password.
Set the schema (or load the available schemas and pick one).
Choose Test connection.
Choose Save connection. STYD then offers to analyse the database with the AI Guide: the first analysis may be included, otherwise it shows the price and asks an owner or admin to confirm.

Network and access

STYD connects from the internet and only runs read queries. Your database must be reachable at a public address, and the port must be open through any firewall or security group. If your server only accepts approved addresses, allow STYD’s two addresses: 109.123.235.222 (IPv4) and 2407:3640:2324:5796::1 (IPv6). On the database side, also check listen_addresses and a pg_hba.conf rule for the user.

A database on localhost or on a private network (for example 10.x, 192.168.x) is not reachable from STYD Cloud, and there is no SSH tunnel option. If that is your situation, a custom, private installation can reach it: see Custom AI.
If the address goes through Cloudflare’s proxy (the orange cloud), it cannot carry database connections. Use a DNS-only name, or the server’s own address.
Whether SSL/TLS is required depends on your database and network. If your database enforces it, confirm the right setup with your database administrator.

Safety

Use a read-only database user, and never share production credentials in public places (screenshots, tickets, chat). Always test the connection before relying on it in chat.