Open source · MIT
MediaGarrd zips the configuration of the services on your Docker host on a schedule, keeps the newest archives, and has a client on another machine download the newest archive. Any service can be backed up: you give it a name and the host paths that matter.
/sudo ./mgrecover.sh <archive>.zipRuns next to the services it backs up and talks to Docker through /var/run/docker.sock.
/config, unlocked with a Setup PIN from its logs.Runs anywhere else on your network. A backup on the same disk as the data doesn't protect much.
MEDIAGARRD_SERVER_IP.-AD suffix.CLIENT_PASSWORD.Anything you can point at. A service is just a name and a list of absolute host paths:
This is the Client dashboard, running in your browser against a simulated server that is already set up. Nothing leaves this page. Connect to the server, pair with the Pairing PIN from its logs, then change its configuration and run backups. The dashboard updates live, with no refreshing. The real Client also asks for a dashboard password on first visit, which the demo leaves out.
http://192.168.1.50:8081/Last scan: not run yet.
No server connected.
A pairing code lets one more client pair with this server. It works once and expires after 10 minutes.
| Get |
|---|
No backups loaded. Connect to a server to view archives.
| Name | Paths |
|---|
No services configured yet.
Each entry sits at its absolute host path without the leading /, with no folder per service. Services backing up /etc/nginx/sites-available/default and /srv/radarr/config produce:
etc/nginx/sites-available/default srv/radarr/config/ srv/radarr/config/config.xml srv/radarr/config/radarr.db srv/radarr/config/logs -> /var/log/radarr
Hard links are stored as regular copies, and empty directories are kept. Named pipes, sockets and device files are skipped. If two services back up the same path, it appears once.
The client's archive list updates by itself when a run finishes or retention deletes an old archive.
Restore archives with mgrecover (latest release). It puts every file back at its original path with contents, permissions, owners (as root) and modification times. Unlike plain extraction, it prints a plan and asks for confirmation first, recreates a symbolic link only if its target exists on the machine or in the archive, and refuses the whole archive, before writing anything, if a name is unsafe. It needs bsdtar (the libarchive-tools package on Debian/Ubuntu), bash 4+, coreutils, awk and sed.
curl -fLO https://github.com/MediaGarrd/Recovery/releases/latest/download/mgrecover.sh chmod +x mgrecover.sh
Stop the MediaGarrd server first: the archive contains its database, and restoring over a running server corrupts it. Then restore:
sudo ./mgrecover.sh 20261026-120000-000-media-backup.zip
To preview, -n prints the plan and writes nothing. To look inside a backup, -C <dir> restores under that directory instead of / and creates no symbolic links.
sudo ./mgrecover.sh -n 20261026-120000-000-media-backup.zip sudo ./mgrecover.sh -C /tmp/restore 20261026-120000-000-media-backup.zip
sudo bsdtar -xpPf <archive>.zip -C / extracts every entry exactly as stored, including links whose targets are missing, with none of these checks. unzip 6.00 doesn't restore owners, and Python's zipfile and most GUI archive managers restore only file contents.
Both parts need Docker with Compose v2, and the server needs a Linux host. The defaults in each compose file work as-is.
git clone --depth 1 https://github.com/MediaGarrd/Server.git cd Server cp docker-compose.example.yml docker-compose.yml docker compose up --build -d
Get the Setup PIN from the logs:
docker logs mediagarrd-server 2>&1 | grep "Setup PIN"
Then open http://<server-ip>:38471/config, enter the Setup PIN, add your services and press Finish Setup.
Finish Setup shows a Pairing PIN. It is also printed in the logs, and it stops working once a Client has paired:
docker logs mediagarrd-server 2>&1 | grep "Pairing PIN"
git clone --depth 1 https://github.com/MediaGarrd/Client.git cd Client cp docker-compose.example.yml docker-compose.yml docker compose up --build -d
Open http://<client-ip>:8081 right away and choose a dashboard password: whoever opens a new dashboard first chooses it. To choose it yourself, add CLIENT_PASSWORD to the client's environment.
Connect to the server by IP or with Scan Local Network, then enter the Pairing PIN to pair. To connect automatically, add MEDIAGARRD_SERVER_IP=<server-ip> to the client's environment.
To pair another Client, press Create Pairing Code in a paired Client's dashboard and enter the code in the new one. A code works once and expires after 10 minutes.
A scan only sees servers on the client's own Docker network unless you add network_mode: host and remove the client's ports mapping.
The dashboard follows the server live, so there is nothing to reload. If the server stops responding, the connection badge turns to Unreachable and recovers by itself.
Once a day it checks GitHub for newer vX.Y.Z releases of the server and the client. The Versions panel at the bottom of the dashboard shows Up-to-date, or Update available with a link to the release page.
| Setting | Where | Default |
|---|---|---|
| Server port | SERVER_PORT + ports | 8080 (38471 in the example compose file) |
| Time between backups | Setup page, then the client | PT12H |
| Backups to keep | Setup page, then the client | 10 |
| Archives on the server host | Server volume | ./data/server/backups |
| Client port | CLIENT_PORT + ports | 8081 |
| Time between client downloads | Client dashboard | PT12H |
| Client dashboard password | First visit, or CLIENT_PASSWORD | None until the first visitor sets it |
| Downloads on the client host | Client volume | ./data/client/downloads |