documentation/cookbook/integrations/grafana/read-only-user.md
Configure a dedicated read-only user for Grafana to improve security by preventing accidental data modifications through dashboards. This allows you to maintain separate credentials for visualization (read-only) and administration (full access), following the principle of least privilege.
:::note QuestDB Enterprise For QuestDB Enterprise, use the comprehensive Role-Based Access Control (RBAC) system to create granular user permissions and roles. The configuration below applies to QuestDB Open Source. :::
You want to:
INSERT, UPDATE, DELETE, or DROP operations from dashboardsCREATE TABLE, etc.) from the QuestDB web consoleHowever, QuestDB's PostgreSQL wire protocol doesn't support standard PostgreSQL user management commands like CREATE USER or GRANT.
QuestDB Open Source supports a built-in read-only user that can be enabled via configuration. This gives you two users:
admin): Full access for DDL and DML operationsuser): Query-only access for dashboardsAdd these settings to your server.conf file or set them as environment variables:
Via server.conf:
# Enable the read-only user
pg.readonly.user.enabled=true
# Optional: Customize username (default is "user")
pg.readonly.user=grafana_reader
# Optional: Customize password (default is "quest")
pg.readonly.password=secure_password_here
Via environment variables:
export QDB_PG_READONLY_USER_ENABLED=true
export QDB_PG_READONLY_USER=grafana_reader
export QDB_PG_READONLY_PASSWORD=secure_password_here
Via Docker:
docker run \
-p 9000:9000 -p 8812:8812 \
-e QDB_PG_READONLY_USER_ENABLED=true \
-e QDB_PG_READONLY_USER=grafana_reader \
-e QDB_PG_READONLY_PASSWORD=secure_password_here \
questdb/questdb:latest
After enabling, you have two separate users:
Admin user (web console):
admin (default)quest (default)SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTERRead-only user (Grafana):
grafana_reader (or whatever you configured)secure_password_here (or whatever you configured)SELECT queries only:::info Related Documentation