Sync Plex ratings/Playlists with Lidarr to block disliked albums from re-downloading.
1.0K
This image is published on Docker Hub:
tobotec/plex-lidarr-sync:latest
All setup options read the configuration from a .env file.
Create a .env file in your working directory:
# Required
PLEX_URL=http://your-plex-server:32400
PLEX_TOKEN=your_token_here
LIDARR_URL=http://your-lidarr-server:8686
LIDARR_API_KEY=your_api_key_here
PLEX_MUSIC_LIBRARY=Music
PLEX_PLAYLIST_NAME="Disliked Albums"
REQUEST_TIMEOUT=10
# Safety
DRY_RUN=false
The simplest way to run the container using Docker directly.
Pull the latest image:
docker pull tobotec/plex-lidarr-sync:latest
docker run --rm \
--env-file .env \
tobotec/plex-lidarr-sync:latest
The container will execute once and exit.
Edit root crontab:
sudo crontab -e
Add a nightly job (runs at 3:00 AM):
0 4 * * * cd /path-to-plex-lidarr-sync && docker run --rm --env-file .env tobotec/plex-lidarr-sync:latest
Update /path-to-plex-lidarr-sync to your actual directory.
Since the container runs with --rm, logs are visible only during execution.
To persist logs for scheduled runs:
0 4 * * * cd /path-to-plex-lidarr-sync && docker run --rm --env-file .env tobotec/plex-lidarr-sync:latest >> plex-lidarr-sync.log 2>&1
Pull the latest version:
docker pull tobotec/plex-lidarr-sync:latest
Deploy the application as a scheduled service in a Docker Swarm cluster.
swarm-cronjob service deployeddocker swarm init
docker service create \
--name swarm-cronjob \
--constraint "node.role==manager" \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
crazymax/swarm-cronjob:latest
docker-swarm-compose.ymlversion: "3.8"
services:
plex-lidarr-sync:
image: tobotec/plex-lidarr-sync:latest
environment:
environment:
PLEX_URL: ${PLEX_URL}
PLEX_TOKEN: ${PLEX_TOKEN}
LIDARR_URL: ${LIDARR_URL}
LIDARR_API_KEY: ${LIDARR_API_KEY}
PLEX_MUSIC_LIBRARY: ${PLEX_MUSIC_LIBRARY}
PLEX_PLAYLIST_NAME: ${PLEX_PLAYLIST_NAME}
REQUEST_TIMEOUT: ${REQUEST_TIMEOUT}
DRY_RUN: ${DRY_RUN}
PYTHONUNBUFFERED: "1"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
labels: "service=plex-lidarr-sync"
deploy:
mode: replicated
replicas: 0
placement:
constraints:
- node.role == worker
labels:
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=0 7 * * *"
- "swarm.cronjob.skip-running=false"
restart_policy:
condition: none
Load your .env into the shell:
export $(grep -v '^#' .env | xargs)
Deploy:
docker stack deploy -c docker-swarm-compose.yml plex-lidarr-sync
Verify:
docker stack services plex-lidarr-sync
Edit the schedule under:
swarm.cronjob.schedule=
Common patterns:
* * * * * # Every minute
0 * * * * # Every hour
0 3 * * * # Daily at 3:00 AM
0 2 * * 0 # Weekly (Sunday 2 AM)
0 0 1 * * # Monthly (1st at midnight)
View service logs:
docker service logs plex-lidarr-sync
Stream logs:
docker service logs -f plex-lidarr-sync_plex-lidarr-sync
Inspect tasks:
docker stack ps plex-lidarr-sync
Pull the latest image:
docker pull tobotec/plex-lidarr-sync:latest
Force service update:
docker service update --force plex-lidarr-sync_plex-lidarr-sync
Or redeploy:
docker stack rm plex-lidarr-sync
docker stack deploy -c docker-swarm-compose.yml plex-lidarr-sync
Service not running
docker service ls | grep swarm-cronjob
docker stack ps plex-lidarr-sync
docker service logs plex-lidarr-sync
Cronjob not firing
docker service logs swarm-cronjob
Ensure:
replicas: 0 is setrestart_policy.condition: none is set| Mode | Best For |
|---|---|
| Standalone Docker | Single host, simple cron usage |
| Docker Swarm | Clustered environments, centralized scheduling |
Both modes pull the image directly from Docker Hub and do not require building locally.
Content type
Image
Digest
sha256:fe8f6cd31…
Size
45.9 MB
Last updated
8 months ago
docker pull tobotec/plex-lidarr-sync