Media Server Guide
Raspberry Pi + Windows PC Setup
System Overview
This guide will walk you through setting up a powerful, efficient, and secure automated media server. We'll use a Raspberry Pi 4 for downloading to keep it separate and low-power, and a Windows PC to manage, process, and serve the media with Plex. Here’s a visual of how data will flow:
Internet
Content Sources
Raspberry Pi 4
Mullvad VPN
qBittorrent
Windows 11 PC
Sonarr, Radarr, Lidarr
Plex Media Server
(Network Storage)
Part 1: Raspberry Pi 4 Setup
The Pi will be our dedicated, 24/7 download machine. All its traffic will be routed through Mullvad VPN for security and privacy.
1.1 - Install Raspberry Pi OS & qBittorrent
Start with a fresh install of Raspberry Pi OS Lite (64-bit) for best performance. Once installed and you can SSH into it, run these commands:
# Update your system
sudo apt update && sudo apt upgrade -y
# Install qBittorrent (headless version)
sudo apt install qbittorrent-nox -y
# Start qbittorrent-nox once to generate config files
qbittorrent-nox
After running it, it will ask you to agree to the terms. Type 'y' and press Enter. Then, press Ctrl+C to stop it. We will run it as a service later.
1.2 - Install & Configure Mullvad VPN
Mullvad's command-line interface (CLI) is perfect for a headless Pi.
# Download and install the Mullvad .deb package
# Go to Mullvad's website to get the latest link for Debian/Raspberry Pi
wget --content-disposition https://mullvad.net/download/app/deb/latest
sudo apt install ./MullvadVPN-*.deb
# Log in to your account
mullvad account login YOUR_MULLVAD_ACCOUNT_NUMBER
# Enable the kill switch (it's on by default, but good to be sure)
mullvad always-require-vpn set on
# Set your location (optional, e.g., for a US server)
mullvad relay set location us
# Connect to the VPN
mullvad connect
# Check the status
mullvad status
Critical Step: Find Your VPN Network Interface
We need to tell qBittorrent to ONLY use the VPN connection. Run `ip a` to find the Mullvad interface. It will likely be named `mullvad-wg` or `wg-mullvad`. Note this name down!
1.3 - Deep Dive: qBittorrent Settings
Access the qBittorrent Web UI at `http://[Your_Pi_IP_Address]:8080`. Default login is `admin` / `adminadmin`. Change this immediately under Tools > Options > Web UI. The settings below are crucial for security and performance on a Pi.
Connection
This is the MOST important setting. It binds qBittorrent to Mullvad, preventing any traffic from leaking if the VPN disconnects.
BitTorrent
Privacy
When using a VPN, it's best to disable these features to prevent potential IP leaks to peers outside the torrent swarm.
Advanced
These settings help performance on a low-power device like the Pi.
Lowering this value reduces RAM usage during file checks, which is beneficial for the Pi.
Part 2: Windows PC Setup
The Windows PC will be the brain of the operation, managing the media library and serving it via Plex.
2.1 - Install the *Arr Suite and Plex
Download and install the latest versions of Sonarr (for TV shows), Radarr (for movies), Lidarr (for music), and Plex Media Server on your Windows 11 machine.
2.2 - Create and Share Your Media Folder
This is a vital step for connecting the Pi and the Windows PC.
- Create a main folder on your PC, e.g., `D:\Media`.
- Inside `D:\Media`, create the following subfolders: `downloads`, `tv`, `movies`, `music`.
- Right-click the `D:\Media` folder, go to Properties > Sharing > Advanced Sharing.
- Check "Share this folder". Click "Permissions", and give your Windows user account "Full Control".
- Note down the "Network Path". It will look like `\\YOUR-PC-NAME\Media`.
Part 3: Linking Services
Now we make the applications talk to each other. This involves mounting the Windows share on the Pi and then configuring the *Arr apps.
3.1 - Mount Windows Share on Raspberry Pi
This makes the Windows `D:\Media` folder accessible on the Pi. SSH into your Pi and run these commands:
# Install tools to mount Windows (SMB) shares
sudo apt-get install cifs-utils -y
# Create a directory on the Pi to mount the share to
sudo mkdir /mnt/media
# Open the fstab file to auto-mount on boot
sudo nano /etc/fstab
# Add this line to the bottom of the file.
# Replace values with your own.
//WINDOWS_PC_IP/Media /mnt/media cifs username=YOUR_WINDOWS_USER,password=YOUR_WINDOWS_PASSWORD,iocharset=utf8,vers=3.0,uid=pi,gid=pi 0 0
Press Ctrl+X, then Y, then Enter to save. Reboot the Pi with `sudo reboot`. After it restarts, you should be able to see the contents of your Windows share by running `ls /mnt/media`.
Finally, in the qBittorrent Web UI, set your default save path to `/mnt/media/downloads`.
3.2 - Configure Sonarr/Radarr Download Client
The process is identical for Sonarr, Radarr, and Lidarr. We'll use Sonarr as the example.
- In Sonarr, go to Settings > Download Clients.
- Click the `+` icon and choose qBittorrent.
- Fill in the details:
- Name: qBittorrent on Pi
- Host: Your Raspberry Pi's IP address
- Port: 8080
- Username: Your qBittorrent username
- Password: Your qBittorrent password
- Click "Test". You should see a green checkmark. Save it.
3.3 - Critical: Remote Path Mappings
This tells Sonarr/Radarr how to translate the Pi's file path to the Windows file path. This is the #1 point of failure for most setups.
- In Sonarr/Radarr, go to Settings > Download Clients.
- Find your qBittorrent client and scroll to the bottom to find Remote Path Mappings.
- Click `+` to add a new mapping:
- Host: Your Raspberry Pi's IP address
- Remote Path: `/mnt/media/downloads/` (what qBittorrent sees)
- Local Path: `D:\Media\downloads\` (what Sonarr/Radarr sees)
- Save. Now when a download finishes, Sonarr/Radarr will know where to find the files to move them to your final library (`D:\Media\tv` or `D:\Media\movies`).
Part 4: Troubleshooting & Common Issues
If things aren't working, check these common problems and solutions.
Issue: *Arr app cannot connect to qBittorrent.
Solution: Check for firewalls. Windows Defender Firewall might be blocking the connection. Create an inbound rule to allow connections on port 8080. Also, double-check that you have the correct IP address, port, username, and password.
Issue: Torrents are downloaded but are not imported/moved.
Solution: This is almost always a path mapping issue. Double-check your Remote Path Mappings in Sonarr/Radarr. Ensure the paths are exactly correct. Also, verify that the user account Sonarr/Radarr is running as has permission to read/write to your `D:\Media` folder.
Issue: Torrents are stuck at "Stalled" or 0 peers.
Solution: This can be a VPN issue. First, confirm the VPN is connected (`mullvad status` on the Pi). Second, check that you have bound qBittorrent to the correct network interface. If you are using a VPN that supports port forwarding, ensure it is configured correctly in both your VPN account and qBittorrent's connection settings.