Plex + Real-Debrid: The Complete Setup
Build the ultimate streaming setup with Plex, Real-Debrid, Zurg, rclone, and Riven. Full control, family sharing, beautiful metadata — everything.
What you'll need
- ✓ Real-Debrid account — €3-16 depending on plan length
- ✓ Linux server or VPS — Ubuntu 22.04+ recommended, 2GB+ RAM
- ✓ Docker & Docker Compose — For running all services
- ✓ Plex account — Free at plex.tv
- ✓ Terminal/SSH access — Comfortable with command line
- ✓ 2-4 hours — Depending on experience level
Not comfortable with Docker/Linux? Check out our ElfHosted guide for a zero-maintenance alternative, or the simpler Stremio + Torrentio setup.
Understanding the architecture
This setup connects several tools to create a seamless streaming experience:
┌─────────────────────────────────────────────────────────────────┐ │ Your Streaming Stack │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ Real-Debrid (Cloud) │ │ │ │ │ ▼ │ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │ │ Zurg │───▶│ rclone │───▶│ Plex │◀───│ Riven │ │ │ │ WebDAV │ │ mount │ │ Server │ │ Manager │ │ │ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │ │ │ │ │ │ │ ▼ ▼ │ │ │ /mnt/zurg Plex Clients │ │ │ (filesystem) (TV, Phone, etc) │ │ │ │ │ │ Plex Watchlist/Trakt ────────┘ │ │ │ └─────────────────────────────────────────────────────────────────┘
Component roles:
- • Zurg — Creates WebDAV server from Real-Debrid
- • rclone — Mounts WebDAV as local filesystem
- • Plex — Beautiful media server with apps
- • Riven — Automates content discovery & management
Benefits:
- • Plex's beautiful UI and metadata
- • Share with family (managed users)
- • Persistent library (doesn't disappear)
- • Automated content acquisition
Step 1: Set up Real-Debrid
1.1 Create account & subscribe
- 1. Go to real-debrid.com
- 2. Create an account and verify email
- 3. Purchase a subscription (180 days is best value at €16)
1.2 Get your API key
- 1. Go to real-debrid.com/apitoken
- 2. Copy your API key
- 3. Save it somewhere secure — you'll need it multiple times
Keep this key private! Anyone with your API key can use your Real-Debrid account.
Step 2: Install Docker
2.1 Install Docker Engine
# Install Docker (Ubuntu/Debian)
curl -fsSL https://get.docker.com | sh
# Add your user to docker group
sudo usermod -aG docker $USER
# Log out and back in, then verify
docker --version
docker compose version 2.2 Create project directory
# Create main directory
mkdir -p ~/plex-debrid
cd ~/plex-debrid
# Create subdirectories
mkdir -p zurg rclone plex/config plex/transcode riven/data riven/symlinks Step 3: Deploy Zurg
3.1 Create Zurg configuration
Create the Zurg config file:
# Create config file
nano ~/plex-debrid/zurg/config.yml Add this configuration:
# ~/plex-debrid/zurg/config.yml
zurg: v1
token: YOUR_REAL_DEBRID_API_KEY # Replace with your key
host: "[::]"
port: 9999
directories:
movies:
group: media
filters:
- regex: /.*\.(mkv|mp4|avi)$/i
shows:
group: media
filters:
- regex: /.*\.(mkv|mp4|avi)$/i Important: Replace YOUR_REAL_DEBRID_API_KEY with your actual API key.
Step 4: Configure rclone mount
4.1 Create rclone configuration
# Create rclone config
nano ~/plex-debrid/rclone/rclone.conf Add this configuration:
# ~/plex-debrid/rclone/rclone.conf
[zurg]
type = webdav
url = http://zurg:9999
vendor = other
pacer_min_sleep = 0 4.2 Create mount point
# Create the mount directory
sudo mkdir -p /mnt/zurg
sudo chown $USER:$USER /mnt/zurg Step 5: Install Plex
5.1 Get your Plex claim token
- 1. Go to plex.tv/claim
- 2.
Copy the claim token (starts with
claim-) - 3. This token expires in 4 minutes, so get it right before starting Plex
Step 6: Set up Riven
Riven will handle content discovery and management. It watches your Plex watchlist (or Trakt) and automatically adds content to your library.
For detailed Riven configuration, see our dedicated Riven guide.
Step 7: Configure Plex libraries
7.1 Access Plex
- 1. Open http://your-server-ip:32400/web
- 2. Sign in with your Plex account
- 3. Complete the initial setup wizard
7.2 Add libraries
- 1. Go to Settings → Libraries → Add Library
- 2.
Add a Movies library pointing to
/mnt/zurg/movies - 3.
Add a TV Shows library pointing to
/mnt/zurg/shows
7.3 Important: Disable automatic scanning
Critical step! Automatic scanning can overload Real-Debrid.
- 1. Go to Settings → Library
- 2. Set "Scan my library automatically" to OFF
- 3. Set "Run a partial scan when changes detected" to OFF
Riven will trigger targeted library scans when new content is added.
Complete docker-compose.yml
Here's the complete Docker Compose file with all services:
# ~/plex-debrid/docker-compose.yml
services:
# Zurg - WebDAV server for Real-Debrid
zurg:
image: ghcr.io/debridmediamanager/zurg-testing:latest
container_name: zurg
restart: unless-stopped
ports:
- "9999:9999"
volumes:
- ./zurg/config.yml:/app/config.yml
- ./zurg/data:/app/data
# rclone - Mounts Zurg as filesystem
rclone:
image: rclone/rclone:latest
container_name: rclone
restart: unless-stopped
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
devices:
- /dev/fuse
volumes:
- ./rclone/rclone.conf:/config/rclone/rclone.conf
- /mnt/zurg:/data:shared
command: >
mount zurg: /data
--config=/config/rclone/rclone.conf
--allow-other
--allow-non-empty
--dir-cache-time=10s
--vfs-cache-mode=full
--vfs-cache-max-size=10G
--vfs-read-chunk-size=8M
--vfs-read-chunk-size-limit=2G
--buffer-size=8M
--poll-interval=30s
depends_on:
- zurg
# Plex Media Server
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
restart: unless-stopped
network_mode: host
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- VERSION=docker
- PLEX_CLAIM=claim-XXXXXXX # Get from plex.tv/claim
volumes:
- ./plex/config:/config
- ./plex/transcode:/transcode
- /mnt/zurg:/mnt/zurg:shared
depends_on:
- rclone
# Riven Frontend
riven-frontend:
image: spoked/riven-frontend:latest
container_name: riven-frontend
restart: unless-stopped
ports:
- "3000:3000"
environment:
- BACKEND_URL=http://riven:8080
- DIALECT=postgres
- DATABASE_URL=postgresql://postgres:postgres@riven-db:5432/riven
depends_on:
- riven
# Riven Backend
riven:
image: spoked/riven:latest
container_name: riven
restart: unless-stopped
ports:
- "8080:8080"
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven-db:5432/riven
volumes:
- ./riven/data:/riven/data
- ./riven/symlinks:/mnt/zurg/symlinks
- /mnt/zurg:/mnt/zurg:shared
depends_on:
- riven-db
- rclone
# Riven Database
riven-db:
image: postgres:16-alpine
container_name: riven-db
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=riven
volumes:
- riven-db-data:/var/lib/postgresql/data
volumes:
riven-db-data: Before starting: Replace claim-XXXXXXX with a fresh claim token from plex.tv/claim.
Start everything
# Start all services
cd ~/plex-debrid
docker compose up -d
# Watch the logs
docker compose logs -f
# Check all containers are running
docker compose ps You're done!
Access your services at:
- • Plex: http://your-ip:32400/web
- • Riven: http://your-ip:3000
- • Zurg: http://your-ip:9999
Troubleshooting
rclone mount not working / empty directory
- • Ensure fuse is installed:
sudo apt install fuse3 - • Check Zurg is running:
docker logs zurg - • Verify rclone can connect:
docker exec rclone rclone lsd zurg: - • Check mount permissions and --allow-other flag
Plex not finding content
- • Verify mount is visible inside Plex container
- • Check library paths match mount paths exactly
- • Ensure content exists:
ls /mnt/zurg - • Manually trigger a library scan in Plex
Buffering / slow playback
- • Increase rclone vfs-cache-max-size
- • Check Real-Debrid server status
- • Try disabling Plex transcoding (direct play)
- • Verify network speed to your server
Zurg showing "token invalid"
- • Verify your Real-Debrid API key is correct
- • Check your Real-Debrid subscription is active
- • Generate a new API key at real-debrid.com/apitoken
- • Restart Zurg after updating config
Real-Debrid IP ban / "Action not allowed from IP"
- • Real-Debrid allows only 1 IP at a time
- • Disable VPN if using one
- • Wait 1 hour if you changed IPs recently
- • Consider upgrading to TorBox for multi-IP support
Tips for best experience
🎯 Use Plex Watchlist
Add content to your Plex watchlist and Riven will automatically fetch it. No need to manually search.
👨👩👧👦 Share with family
Add managed users in Plex to share your library with family. Each user gets their own watchlist and history.
🎬 Direct Play when possible
Configure Plex clients to use "Original" quality to avoid transcoding. Saves CPU and provides best quality.
🔄 Keep services updated
Run docker compose pull && docker compose up -d periodically to update all services.
Need something simpler?
If this setup is too complex, check out our easier alternatives.