plex-dbrepair

plex-dbrepair

Docker app from bmartino1's Repository

Plex DBRepair is a one shot Plex database maintenance tool using ChuckPa DBRepair version 26 10 00 Automatically discovers a running Plex Docker container through the host Docker…

Requirements

YOU ARE ULTIMATELY RESPONSIBLE FOR YOUR DATA. Requires access to /var/run/docker.sock and one supported RUNNING Plex container. The Docker socket grants host-level administrative privileges. Verify backups before changing databases. No Plex appdata bind mount is required. Install as a one-shot container with restart policy No. Binhex and Hotio have not yet been tested and validated, but should still work
Overview
Plex DBRepair is a one shot Plex database maintenance tool using ChuckPa DBRepair version 26 10 00 Automatically discovers a running Plex Docker container through the host Docker socket and copies the DBRepair executable into it Stops the Plex Media Server process while keeping the Docker container running where supported Performs the selected database maintenance operation and restarts the Plex container after success No Plex appdata mount is required in the repair container Supported modes are automatic check vacuum repair reindex deflate and prune If more than one Plex container is detected set PLEX_CONTAINER_NAME to the exact container name Persistent logs are stored in the logs directory Database backups are enabled by default for all modes except prune CAUTION This tool modifies Plex databases and users are responsible for maintaining verified backups Tested successfully with LinuxServer Plex on a disposable installation Binhex and Hotio compatibility has not yet been verified If the Plex process restarts unexpectedly or the Plex container exits during maintenance the repair operation may stop without restarting Plex Set the repair container restart policy to No to prevent repeated maintenance operations

DBRepair

If you're reading this, you are on the wrong branch.

DBRepair.sh and the Windows .bat/.ps1 scripts are retired.

DBRepair is now a compiled program on the main branch: https://github.com/ChuckPa/DBRepair/tree/main

Download the latest release for your OS and CPU: https://github.com/ChuckPa/DBRepair/releases/latest

Copyright (c) 2022-2026, ChuckPa. All Rights Reserved.

Categories

Download Statistics

25,222
Total Downloads
5,303
This Month
5,303
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Explore more like this

Explore all

Links

Details

Repository
bmmbmm01/plex-dbrepair
Last Updated2026-10-29
First Seen2026-01-11

Runtime arguments

Network
bridge
Shell
bash
Privileged
false
Extra Params
--hostname dbrepair

Template configuration

Maintenance ModeVariable

automatic=upstream auto; check=integrity checks; vacuum=compact; repair=rebuild including FTS; reindex=rebuild indexes; deflate=compact only if needed; prune=PhotoTranscoder cleanup. Select one mode.

Target
DBREPAIR_MODE
Default
automatic
Value
automatic
Plex Container NameVariable

auto detects one eligible Plex container. If you have multiple Plex containers, enter the exact Docker container name shown by docker ps (example: plex). Do not enter a Docker image name here.

Target
PLEX_CONTAINER_NAME
Default
auto
Value
auto
Enable Database BackupsVariable

Create timestamped cold database archives inside the TARGET Plex container at Plex Media Server/DBRepair-Backups; skipped for prune. Backups take disk space and are not automatically deleted.

Target
ENABLE_BACKUPS
Default
true
Value
true
Restart Plex After SuccessVariable

Restart the target Plex Docker container after successful maintenance. On database errors the script intentionally does not auto-restart Plex.

Target
RESTART_PLEX
Default
true
Value
true
Prune DaysVariable

For prune mode only: remove eligible PhotoTranscoder cached files older than this number of days.

Target
PRUNE_DAYS
Default
30
Value
30
Plex Container MatchVariable

Case-insensitive name substring used when Plex Container Name=auto. Image names containing plex are also considered. Candidates must contain the Plex database at the configured path.

Target
PLEX_CONTAINER_MATCH
Default
plex
Value
plex
Plex Internal Config MountVariable

Path INSIDE the target Plex container to its config mount, usually /config. This is NOT a host volume to mount to DBRepair.

Target
PLEX_MOUNT
Default
/config
Value
/config
Plex Internal Relative PathVariable

Relative path inside the target Plex container's config directory. Leave at default unless that Plex installation differs.

Target
PLEX_REL
Default
Library/Application Support/Plex Media Server
Value
Library/Application Support/Plex Media Server
Allow Process Shutdown FallbackVariable

If upstream DBRepair stop cannot shut down Plex, allow SIGTERM to the Plex Media Server process. No forced Docker stop/offline repair fallback is implemented.

Target
ALLOW_PLEX_KILL
Default
true
Value
true
Maintenance Timeout SecondsVariable

Maximum DBRepair operation duration in seconds. A failure or timeout requires reviewing the database before restarting Plex.

Target
DBREPAIR_TIMEOUT
Default
7200
Value
7200
Plex Shutdown Timeout SecondsVariable

Maximum seconds to wait for the Plex process to stop before aborting.

Target
STOP_TIMEOUT
Default
90
Value
90
Persistent Repair LogsPathrw

Host folder for timestamped DBRepair execution logs. Docker logs also show output.

Target
/logs
Default
/mnt/user/appdata/plex-dbrepair-logs
Value
/mnt/user/appdata/plex-dbrepair-logs
Host Docker SocketPathrw

REQUIRED: Docker host socket for discovering Plex and running docker inspect/exec/cp/restart. Grants this tool host-level Docker control.

Target
/var/run/docker.sock
Default
/var/run/docker.sock
Value
/var/run/docker.sock