This repository contains a script for setting up a media server on your Raspberry Pi4. The script installs and configures the following applications:
Before running the script, you will need:
- A Raspberry Pi4 running Raspberry Pi OS (tested on 64-bit)
- An internet connection
- Sudo privileges
To start the installation, follow these steps:
- Clone or download this repository to your Raspberry Pi4.
- Open a terminal and navigate to the cloned repository.
- Run the following command to make the script executable:
chmod +x setup.sh
- Run the script with sudo privileges:
sudo ./setup.sh
-
The
scripts
folder contains some useful scripts for managing the applications. These scripts are not installed by default, but can be run via cronjobs or manually. -
Plex stores its metadata in
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server
. This folder can be symlinked to an external drive to save space on the root partition. Just make sure to stop the Plex service first, then copy the folder to the external drive and symlink it back to the original location.sudo systemctl stop plexmediaserver
- Replace <external_path> -
sudo mv /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server /<external_path>/plexmediaserver
- Replace <external_path> -
sudo ln -s /<external_path>/plexmediaserver /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server
- Reboot or call
sudo systemctl start plexmediaserver
You can verify that the symlink is working with -
ls -l /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server
-
I have setup Radarr to fetch movies from a number of "lists" on Trakt, as well as Plex watchlists. These lists are updated automatically, and Radarr will unmonitor any movies not in a list. The script
radarr_remove_unmonitored.sh
then runs every Monday morning at 04:00 to remove any unmonitored movies, both from disk and Radarr itself. Every day at around 01:30 theradarr_sonarr_search_missing.sh
script runs to make sure all movies and TV shows are fetched. Plex is also set to run its Scheduled Tasks at 05:00, where it generates all the media information, such as intro and credit markers, as well as preview and chapter thumbnails. The scriptqbittorrent_remove_unfinished.sh
is set to run every hour.