Skip to main content
pgconsole uses a TOML configuration file for all settings. By default, it looks for pgconsole.toml in the current directory. You can specify a different path with the --config flag:
pgconsole --config /path/to/pgconsole.toml

Complete Example

[general]
external_url = "https://pgconsole.example.com"
license = "your-license-key"

[general.banner]
text = "System maintenance scheduled for Sunday 2am UTC"
link = "https://status.example.com"
color = "#7c3aed"

[[labels]]
id = "prod"
name = "Production"
color = "#ef4444"

[[labels]]
id = "staging"
name = "Staging"
color = "#f59e0b"

[[connections]]
id = "local"
name = "Local Dev"
host = "localhost"
port = 5432
database = "postgres"
username = "postgres"
password = "postgres"
ssl_mode = "prefer"

[[connections]]
id = "production"
name = "Production DB"
host = "db.example.com"
port = 5432
database = "app"
username = "readonly"
password = "secret"
ssl_mode = "verify-full"
ssl_ca = "/path/to/ca.crt"
ssl_cert = "/path/to/client.crt"
ssl_key = "/path/to/client.key"
labels = ["prod"]
lock_timeout = "5s"
statement_timeout = "30s"

[auth]
jwt_secret = "your-secret-key-at-least-32-characters-long"
signin_expiry = "7d"

[[auth.providers]]
type = "google"
client_id = "your-client-id"
client_secret = "your-client-secret"

[[auth.providers]]
type = "keycloak"
client_id = "pgconsole"
client_secret = "your-client-secret"
issuer_url = "https://keycloak.example.com/realms/your-realm"

[[auth.providers]]
type = "okta"
client_id = "0oaXXXXXXXXXXXXXX"
client_secret = "your-okta-client-secret"
issuer_url = "https://your-org.okta.com/oauth2/default"

[[users]]
email = "[email protected]"
password = "your-password"
owner = true

[[users]]
email = "[email protected]"

[[groups]]
id = "dev-team"
name = "Development Team"
members = ["[email protected]", "[email protected]"]

[[groups]]
id = "dba"
name = "Database Administrators"
members = ["[email protected]"]

[[iam]]
connection = "*"
permissions = ["read"]
members = ["*"]

[[iam]]
connection = "local"
permissions = ["read", "write", "ddl", "admin"]
members = ["user:[email protected]", "group:dba"]

[[ai.providers]]
id = "gpt4"
name = "GPT-4o"
vendor = "openai"
model = "gpt-4o"
api_key = "sk-..."

General

FieldDescriptionRequired
external_urlPublic URL of the application. See Configure External Access.Required for SSO
licenseLicense key. See Manage License.
[general]
external_url = "https://pgconsole.example.com"
license = "your-license-key"

Announcement Banner

Optional banner displayed at the top of the page. The banner cannot be dismissed by users.
FieldDescriptionRequired
textBanner message textYes
linkURL that makes the banner clickable (opens in new tab)
colorHex color code for the banner background
[general.banner]
text = "System maintenance scheduled for Sunday 2am UTC"
link = "https://status.example.com"
color = "#7c3aed"

Labels

Labels for tagging connections (e.g. Production, Staging). Referenced by the labels field in [[connections]]. Repeat for multiple labels.
FieldDescriptionRequired
idUnique identifierYes
nameDisplay nameYes
colorHex color codeYes
[[labels]]
id = "prod"
name = "Production"
color = "#ef4444"

Connections

Database connections. Repeat for multiple connections.
FieldDescriptionRequiredDefault
idUnique identifierYes
nameDisplay nameYes
hostPostgreSQL hostYes
portPostgreSQL port5432
databaseDatabase nameYes
usernameDatabase userYes
passwordDatabase password
ssl_modedisable, prefer, require, or verify-fullprefer
ssl_caPath to CA certificate
ssl_certPath to client certificate
ssl_keyPath to client private key
labelsArray of label IDs[]
lock_timeoutlock_timeout, e.g. "5s"System default
statement_timeoutstatement_timeout, e.g. "30s"System default
lazySkip connection test on startupfalse
[[connections]]
id = "production"
name = "Production DB"
host = "db.example.com"
port = 5432
database = "app"
username = "readonly"
password = "secret"
ssl_mode = "verify-full"
ssl_ca = "/path/to/ca.crt"
ssl_cert = "/path/to/client.crt"
ssl_key = "/path/to/client.key"
labels = ["prod"]
lock_timeout = "5s"
statement_timeout = "30s"

Authentication

To run without authentication, omit the [auth] section entirely.
FieldDescriptionRequired
jwt_secretSecret key for JWT tokens (min 32 chars)Yes
signin_expirySession duration (h/d/w)Yes
[auth]
jwt_secret = "your-secret-key-at-least-32-characters-long"
signin_expiry = "7d"

OAuth Providers

OAuth providers are configured as an array of [[auth.providers]] entries. Each entry requires a type field. Repeat for multiple providers.
FieldDescriptionRequired
typeProvider type: google, keycloak, or oktaYes
client_idOAuth client IDYes
client_secretOAuth client secretYes
issuer_urlIssuer URL (required for keycloak and okta)
# Google
[[auth.providers]]
type = "google"
client_id = "your-client-id.apps.googleusercontent.com"
client_secret = "your-client-secret"

# Keycloak
[[auth.providers]]
type = "keycloak"
client_id = "pgconsole"
client_secret = "your-client-secret"
issuer_url = "https://keycloak.example.com/realms/your-realm"

# Okta
[[auth.providers]]
type = "okta"
client_id = "0oaXXXXXXXXXXXXXX"
client_secret = "your-okta-client-secret"
issuer_url = "https://your-org.okta.com/oauth2/default"

Users

User entries. Repeat for multiple users. Users with a password can sign in with basic auth. Users without a password are SSO-only.
FieldDescriptionRequired
emailUser email or identifierYes
passwordLogin password (omit for SSO-only users)
ownerGrants access to subscription management
[[users]]
email = "[email protected]"
password = "your-password"
owner = true

[[users]]
email = "[email protected]"
# SSO-only user - no password

Owner Role

Users with owner = true can view subscription status and access upgrade options. See Manage License. If no user has owner = true, the first user entry automatically becomes the owner.

Groups

User groups for organizing users. Repeat for multiple groups.
FieldDescriptionRequired
idUnique identifierYes
nameDisplay nameYes
membersArray of user emailsYes
Members are user emails matching [[users]] entries.
[[groups]]
id = "dev-team"
name = "Development Team"
members = ["[email protected]", "[email protected]"]

Access Control (IAM)

Rules for controlling access to connections. See Database Access Control for a full guide on permissions, patterns, and examples.
FieldDescriptionRequired
connectionConnection ID or * for allYes
permissionsArray: read, write, ddl, admin, explain, execute, export, or * for allYes
membersArray: user:<email>, group:<id>, or * for all usersYes
[[iam]]
connection = "*"
permissions = ["read"]
members = ["*"]

[[iam]]
connection = "production"
permissions = ["read", "write"]
members = ["user:[email protected]", "group:dev-team"]

Validation

IAM rules are validated when the configuration is loaded:
  • connection must be * or reference a valid connection ID
  • permissions must only contain valid values: read, write, ddl, admin, explain, execute, export, or *
  • members must use valid formats: user:<email>, group:<id>, or *
  • group:<id> must reference a defined group
Invalid rules will cause the server to fail at startup with an error message.

AI Providers

Configure providers for the AI Assistant. Repeat for multiple providers.
FieldDescriptionRequired
idUnique identifierYes
nameDisplay name (defaults to id)
vendorAI vendor: openai, anthropic, googleYes
modelModel identifierYes
api_keyAPI key for the vendorYes
[[ai.providers]]
id = "gpt4"
name = "GPT-4o"
vendor = "openai"
model = "gpt-4o"
api_key = "sk-..."