Connecting PostgreSQL
Connect a PostgreSQL database to FreshGuard for monitoring.
PostgreSQL requires a Professional plan or higher. Professional+
Connection Fields
When adding a PostgreSQL source, provide the following:
| Field | Description | Example |
|---|---|---|
| Host | Hostname or IP address | db.example.com |
| Port | PostgreSQL port (default 5432) | 5432 |
| Database | Database name | analytics |
| Username | Database user | freshguard_readonly |
| Password | User password | — |
| SSL Mode | SSL connection mode | require |
SSL Modes
FreshGuard supports all standard PostgreSQL SSL modes:
disable— No SSL (not recommended for production).require— Require SSL but don’t verify the server certificate.verify-ca— Require SSL and verify the server certificate against a CA.verify-full— Require SSL and verify both the certificate and the hostname.
Warning
Always use require or stricter for production databases. The disable mode sends credentials in plaintext.
Connection String
As an alternative to filling in individual fields, you can paste a full connection string:
postgresql://freshguard_readonly:password@db.example.com:5432/analytics?sslmode=requireFreshGuard will parse the string and populate the fields automatically.
Common Issues
Connection Timeout
If the test connection hangs or times out:
- Verify your database is accessible from the internet (or from FreshGuard’s outgoing IPs — find them in Settings → Network).
- Check firewall rules and security groups to allow inbound connections on your PostgreSQL port.
- If your database is in a private network, consider setting up a bastion host or VPN.
Authentication Failed
- Confirm the username and password are correct.
- Ensure the user exists and has
CONNECTpermission on the target database. - Check
pg_hba.confallows connections from external hosts.
SSL Required
If you see “SSL connection required” errors, set the SSL Mode to require or higher.
Recommended Setup
For the most secure configuration, create a dedicated read-only role. See the PostgreSQL: Read-Only Role guide for the exact SQL commands.