Your database, but with a regular check-up.
DB Doctor audits the MySQL, MariaDB, or PostgreSQL database powering your Nextcloud against best-practice rules — ported from phpMyAdmin's advisor, plus curated PostgreSQL checks and a set of Nextcloud-specific schema checks — and presents the results as a friendly check-up: an at-a-glance health grade and a plain-English recommendation for every rule that fails. Apply safe runtime fixes with one click, or copy a my.cnf / postgresql.conf snippet for permanent changes.
It is read-only by default, admin-only, and never phones home.
- Health grade A–F with a numeric score, and a plain-English issue + recommendation for every failing rule.
- 50+ MySQL/MariaDB rules ported from phpMyAdmin's advisor (each keeps its upstream
idso future syncs can be tracked), plus curated PostgreSQL checks (cache hit ratio, dead tuples, replication lag, connection saturation, long-running queries, sequential-scan hotspots). - Nextcloud-specific checks that a generic advisor can't express:
- missing indices / columns / primary keys — detected via the same events behind
occ db:add-missing-*, so the recommended fix is exactly theocccommand that resolves it; - 4-byte
utf8mb4charset, InnoDB storage engine, andREAD-COMMITTEDtransaction isolation.
- missing indices / columns / primary keys — detected via the same events behind
- One-click runtime fixes for an allow-listed set of variables (
SET GLOBAL/ALTER SYSTEM), with a downloadable config snippet for everything else. Every apply is recorded in an audit log. - Score trend chart (30-day) and a per-rule sparkline so you can watch health climb over time.
- Live metric tiles (cache hit ratio, connection saturation, throughput) and a live database-latency chart, polled only while the page is visible.
- Weekly automatic check-ups that keep the trend data flowing and notify admins when database health declines.
- Setup check — the grade shows up in Settings → Overview where admins already look for problems.
occ dbdoctor:checkcommand with--output=jsonand Nagios-style exit codes for monitoring integration.- Reverted-fix detection — a runtime fix lost to a database restart is flagged so you can make it permanent.
- Uptime-aware — ratio/rate rules are skipped until the server has enough uptime for their counters to mean anything, so you don't get false alarms right after a restart.
- Optional override connection — point DB Doctor at a separate (e.g. higher-privilege or read-only) database account without changing Nextcloud's main connection; the password is encrypted at rest.
- Nextcloud 33–35
- PHP 8.3 or newer
- MySQL 5.7+ / MariaDB 10.4+ / PostgreSQL 13+
Install DB Doctor from the Nextcloud app store, or build from source (below) and enable it:
sudo -u www-data php occ app:enable dbdoctorOpen it under Settings → Administration → DB Doctor and click Run check now.
Run the advisor from the CLI — handy for cron and monitoring:
# Human-readable summary
sudo -u www-data php occ dbdoctor:check
# Machine-readable, for monitoring systems
sudo -u www-data php occ dbdoctor:check --output=json
# Only list failing rules
sudo -u www-data php occ dbdoctor:check --failing-onlyExit codes follow the Nagios convention: 0 OK, 1 warnings, 2 alerts, 3 unsupported/unknown.
Optional config.php settings:
// Restrict which hosts an admin may point the override connection at
// (defense-in-depth against using the UI as an internal-network probe).
// When absent or empty, every host is allowed.
'dbdoctor.allowed_override_hosts' => ['db1.internal', '10.0.0.5'],Disable the weekly automatic check-up:
sudo -u www-data php occ config:app:set dbdoctor scheduled_checks --value=nocomposer install --no-dev --prefer-dist
npm ci
npm run buildDevelopment helpers: composer test (PHPUnit), npm test (Vitest), npm run lint, npm run watch.
Strings are translated on Transifex via the
standard Nextcloud translation sync (.tx/config + translationfiles/). To contribute a
translation, join the Nextcloud Transifex team — compiled l10n/*.js / l10n/*.json files land
here automatically once the dbdoctor resource is activated for the sync bot.
The MySQL/MariaDB rule set is ported from the phpMyAdmin Advisor, with each rule's upstream id preserved so future syncs can be tracked.
DB Doctor is licensed under AGPL-3.0-or-later. The bundled phpMyAdmin advisor data is GPL-2.0-or-later (upward-compatible), retained intact and tracked via REUSE.toml.



