Keep Plex tokens, API keys, passwords, and certificates outside versioned Compose files and exclude secret material from ordinary configuration backups.
The risk is not limited to public repositories. Environment files, debug logs, copied Compose bundles, and backup archives can all widen access to credentials. Inventory which values are actually secret, inject them at runtime, and make rotation possible without rebuilding the whole stack.
Classify Secrets Before Changing Storage
Not every environment variable is sensitive, but tokens, passwords, private keys, and API credentials should have a different handling path from ordinary settings.
OWASP recommends container secret injection instead of building secrets into images or leaving them exposed through general configuration.
List every credential consumed by Plex, proxies, request tools, and automation. Mark where each value is stored, who can read it, and how it is rotated.
Do Not Hardcode Credentials Into Compose
A Compose file is often copied, committed, emailed, or included in backup bundles. Hardcoded secrets travel with it and can survive long after the original server is replaced.
A safer Docker pattern uses separate secret handling so sensitive values are granted to the service without becoming ordinary configuration text.
Replace hardcoded values with a secret or protected runtime source. Confirm the rendered Compose output and repository history do not still contain the old credential.
Keep Environment Files Out of Broad Backups
An `.env` file can be convenient but still contains plaintext unless another layer protects it. Backing it up beside general configuration can silently expand who receives the credentials.
Compose environment-variable scoping changes how `.env`, `env_file`, and service variables are resolved, so know which file actually contains the live secret.
Separate secret backups from routine app configuration and restrict their access. If you do not need to restore a value because it can be reissued, prefer documented rotation over indefinite retention. Keep credentials outside the persistent app-data layout so ordinary app-data backups do not automatically become secret archives.
Rotate After Exposure or Workflow Changes
Deleting a leaked token from a file does not invalidate copies already made. Treat suspected exposure as a credential-rotation event rather than a file-cleanup task.
Normal backup capacity and churn can create many historical copies, which is why secret rotation matters when one archive may already contain the old value.
Rotate the affected token, update the runtime source, and verify the old value no longer authenticates. Add a secret-scan step before future Compose or backup exports.
Support & Tips
More to Read

Should You Back Up Jellyfin Live or Stop the Service First?
Prefer stopped-service backups for simplicity; use live snapshots only when application state is captured consistently and restores are tested.

Why Does Jellyfin Run Hot or Noisy When Nobody Is Streaming?
Idle heat usually means background work or a shared-host workload, so identify the active process and scheduled task before changing cooling or hardware.

When Should You Rebuild Instead of Repairing Jellyfin?
Choose rebuild over repair when runtime drift is the problem and persistent state is backed up; do not โrebuildโ by deleting the only good...

