Skip to main content
pgconsole uses a TOML configuration file for all settings. Pass the config file with the --config flag. Without --config, pgconsole starts in demo mode.
docker run -p 9876:9876 -v /path/to/pgconsole.toml:/etc/pgconsole.toml pgplex/pgconsole

Complete Example

pgconsole.toml
[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"

[branding]
logo = "https://example.com/your-logo.svg"
logo_link = "https://internal.example.com"

[[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 = "admin@example.com"
password = "your-password"
owner = true

[[users]]
email = "alice@example.com"

[[groups]]
id = "dev-team"
name = "Development Team"
members = ["admin@example.com", "alice@example.com"]

[[groups]]
id = "dba"
name = "Database Administrators"
members = ["admin@example.com"]

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

[[iam]]
connection = "local"
permissions = ["read", "write", "ddl", "admin"]
members = ["user:admin@example.com", "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.
pgconsole.toml
[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
pgconsole.toml
[general.banner]
text = "System maintenance scheduled for Sunday 2am UTC"
link = "https://status.example.com"
color = "#7c3aed"

Branding

Replace the pgconsole logo with your own. Requires an Enterprise license.
FieldDescriptionRequired
logoURL to your logo imageYes
logo_linkWhere the logo links to (absolute path or http(s) URL)
When logo_link is omitted, the logo links to /.
pgconsole.toml
[branding]
logo = "https://example.com/your-logo.svg"
logo_link = "https://internal.example.com"

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
pgconsole.toml
[[labels]]
id = "prod"
name = "Production"
color = "#ef4444"

Connections

Database connections. Repeat for multiple connections.
If connecting to a database on your host machine from Docker, use host.docker.internal instead of localhost.
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
pgconsole.toml
[[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
pgconsole.toml
[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)
pgconsole.toml
# 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
pgconsole.toml
[[users]]
email = "admin@example.com"
password = "your-password"
owner = true

[[users]]
email = "alice@example.com"
# 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.
pgconsole.toml
[[groups]]
id = "dev-team"
name = "Development Team"
members = ["admin@example.com", "alice@example.com"]

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
pgconsole.toml
[[iam]]
connection = "*"
permissions = ["read"]
members = ["*"]

[[iam]]
connection = "production"
permissions = ["read", "write"]
members = ["user:admin@example.com", "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
pgconsole.toml
[[ai.providers]]
id = "gpt4"
name = "GPT-4o"
vendor = "openai"
model = "gpt-4o"
api_key = "sk-..."