Features

How to Back Up Your Plex Server — Protect Your Setup

Published September 1, 2026 · 9 min read

You have spent hours setting up Plex. Library organization, custom metadata edits, watched statuses, user accounts, poster overrides, playlist curation. All of that configuration lives in a database on your server. If a drive fails, an OS update goes wrong, or you accidentally delete the wrong folder, it is all gone. Your media files can be re-downloaded or re-ripped, but the Plex database, your watch history, and your configuration are unique to your server.

Backing up Plex is straightforward once you know which files matter. This guide covers exactly what to back up, where those files live on each platform, how to automate the process, and how to restore from a backup.

What You Need to Back Up

Not everything in the Plex data directory is equally important. Here is a breakdown of what matters, in order of priority:

1. The Plex Database

This is the single most important file. The database (a SQLite file) contains your library structure, watched and unwatched statuses, play counts, ratings, playlists, collections, user accounts, sharing permissions, and all metadata associations. Without it, Plex treats your server as brand new.

The file is located at:

Plug-in Support/Databases/com.plexapp.plugins.library.db

There are also related files like com.plexapp.plugins.library.db-wal and com.plexapp.plugins.library.db-shm (write-ahead log and shared memory). For a clean backup, stop the Plex service before copying, or back up all three files together.

2. Preferences File

The Preferences file stores your server configuration: server name, network settings, transcoder options, remote access configuration, and your server claim token. Losing this file means reconfiguring every server setting from scratch.

3. Metadata

Plex downloads posters, backgrounds, thumbnails, and other artwork for your media. This data lives in the Metadata folder within the Plex data directory. It can be large (tens of gigabytes for big libraries) but it is regenerable. If you lose it, Plex can re-download everything from online sources during a metadata refresh. However, any custom posters or manually added artwork will be lost.

If you have uploaded custom posters, back up the Metadata folder. If you use only automatic metadata, you can skip it to save backup space and time.

4. Media Files

Your actual movies, TV shows, music, and photos are not part of the Plex data directory. They live wherever you store them. Backing up media files is a separate concern and depends on your storage setup (RAID, cloud backup, offsite copies). This guide focuses on the Plex-specific data, not the media itself.

Where the Plex Data Directory Lives

The complete data directory path varies by platform:

PlatformDefault Data Directory
Windows%LOCALAPPDATA%\Plex Media Server\
macOS~/Library/Application Support/Plex Media Server/
Linux (native)/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/
Synology/volume1/PlexMediaServer/AppData/Plex Media Server/
DockerMapped via -v /path/to/config:/config

Within this directory, the critical subdirectories are Plug-in Support/Databases/ (the database), Plug-in Support/Preferences/ (plugin settings), and Metadata/ (artwork and metadata cache). The Cache/ folder can be excluded from backups. It contains transcoder cache, analysis files, and other regenerable data that can consume substantial space.

Manual Backup Process

The simplest approach is a manual copy. Here is the step-by-step process:

  1. Stop Plex Media Server. This ensures the database is not being written to during the copy, which could result in a corrupted backup. On Windows, stop the service in Services. On macOS, quit the app from the menu bar. On Linux, run sudo systemctl stop plexmediaserver.
  2. Copy the critical files. At minimum, copy the Plug-in Support/Databases/ folder and Preferences.xml. If you want a complete backup, copy the entire Plex Media Server data directory minus the Cache/ folder.
  3. Store the backup offsite. Copy the backup to an external drive, a different machine, or cloud storage. A backup on the same drive as the original is not a backup.
  4. Restart Plex Media Server.

Automated Backup with Scripts

Manual backups are better than nothing, but they rely on you remembering to do them. Automated scripts run on a schedule and ensure you always have a recent backup.

Linux and macOS (Bash Script)

Create a script that stops Plex, copies the database and preferences, compresses them, and restarts Plex:

#!/bin/bash
PLEX_DATA="$HOME/Library/Application Support/Plex Media Server"
BACKUP_DIR="$HOME/plex-backups"
DATE=$(date +%Y-%m-%d)

mkdir -p "$BACKUP_DIR"

# Stop Plex
sudo systemctl stop plexmediaserver  # Linux
# or: osascript -e 'quit app "Plex Media Server"'  # macOS

# Create compressed backup
tar -czf "$BACKUP_DIR/plex-backup-$DATE.tar.gz" \
  "$PLEX_DATA/Plug-in Support/Databases/" \
  "$PLEX_DATA/Preferences.xml"

# Restart Plex
sudo systemctl start plexmediaserver  # Linux
# or: open "/Applications/Plex Media Server.app"  # macOS

# Delete backups older than 30 days
find "$BACKUP_DIR" -name "plex-backup-*.tar.gz" -mtime +30 -delete

Schedule this with cron to run weekly or daily. A weekly 3 AM cron entry would be:

0 3 * * 0 /path/to/plex-backup.sh

Windows (PowerShell)

A similar script in PowerShell stops the Plex service, compresses the database folder, and restarts the service. Schedule it with Windows Task Scheduler to run weekly during off-peak hours.

Docker Users

If Plex runs in Docker, your data directory is already mapped to a host path. You can back up the host directory directly without needing to stop the container, though stopping it briefly produces a cleaner backup. Use docker stop plex, copy the mapped volume, then docker start plex.

What You Lose Without a Backup

Understanding the consequences makes backups feel less optional:

Your media files will still be there, but Plex will treat everything as unmatched, unwatched, and unconfigured. For a library with thousands of items, rebuilding from scratch takes days of manual work.

How to Restore from a Backup

  1. Install Plex Media Server on the target machine (or reinstall on the same machine).
  2. Stop Plex before restoring files.
  3. Replace the database files. Copy your backed-up Plug-in Support/Databases/ folder into the new Plex data directory, replacing any files that were created during the fresh installation.
  4. Replace Preferences.xml. Copy your backed-up preferences file into the data directory root.
  5. Start Plex and verify that your libraries, watch history, and settings appear correctly.
  6. Update library paths. If your media files are on different drives or paths than the original server, update each library's folder paths in Plex settings. The database stores absolute paths, so moved media requires path updates.

How Often to Back Up

The right frequency depends on how actively you use Plex. If you add new content daily and have multiple users, weekly backups are the minimum. If your library is stable and changes rarely, monthly backups may suffice.

A good rule of thumb: back up at least as often as you would be willing to lose. If losing a week of watch history is acceptable, back up weekly. If losing a day would be painful, back up daily. The database file is typically under 200 MB even for large libraries, so storage is not a limiting factor.

Phlix — The Photo Browser for Plex

Your Plex photos deserve a great browsing experience. Phlix offers a chronological timeline, offline downloads, and 4K AirPlay slideshows. Free to browse, Pro from $6.99/yr.

Download Phlix Free

iOS 17+ · Works with any Plex Media Server