Plex is a client-server setup where the client directly streams data from the Plex media server. This setup means you can have all your movies, music, and photos located on the one device, the server. NOTE: In my case Plex worked perfectly configured with its default user. By default, the Plex Media Server package will utilize a user named plex. To reduce the chances of dealing with permission issues, we could change the server’s default file. When you compare the cost of a Raspberry Pi 3 at $25 to that of an Apple TV (or similar) at almost $200 it becomes clear why using the Raspberry Pi as a Plex client is a great idea! RELATED: Make a Raspberry Pi Plex Server. There are numerous ways to get Plex Server content on your TV.Personal media streaming powered by RaspberryPi 4 and DietPi
Media streaming isn’t a new thing and since the early days of the internet home media setups have been fairly common. What has changed is the hardware needed powering such a setup. The RasperryPi 4 is a powerful, pocket-sized, computer which can be setup as a home media server with very little cost or effort.
For this setup you’ll need a RaspberryPi (4 if possible), a microSD card and an external drive of your media.
1. Flash SD Card with DietPi
2. Configure DietPi Automations
3. First boot
4. Configure Plex and Tautulli
Flash SD Card with DietPi
DietPi is my goto image when I’m working on RaspberryPi projects (I’ve written a little about this in the past) as it offers a great base image, a simple software configuration and a ton of guides in their docs which is super helpful for getting started.
Head over to the website and download the DietPi image for your device (there are lots of platforms on offer). Each version of the RaspberryPi is catered for in one image:
Flashing the SD card can be done a number of different ways though I prefer the command line and there’s a great guide on raspberrypi.com for macOS (and other plaforms).
In short, use
diskutil list to find the SD card, then unmount with
diskutil unmountDisk /dev/diskN where
diskN is the SD card. e.g
In my case this is
disk2 as the other disks are APFS macOS Volumes and contain boring things like the operating system and my photos.
Next we need to unmount that disk and then copy the image (I’ve openned terminal inside the folder of the DietPi image)
If you have issues running this command the RaspberryPi guide has some suggestions.
Alternatively DietPi recommends using balenaEtcha to flash the drive which offers a more friendly UI to select images, disks and flashes the SD card for you.
Either balenaEtcha or the command line should result in a flashed SD card that looks something like this:
With the fresh DietPi SD card we’re in a good position to plug in a monitor, keyboard and mouse, then start up the Pi. If you are curious and want to try configuring it for yourself then try it out, you’ll be taken through the DietPi setup and their helpful software configuration.
However I much prefer to automate as much of the first setup as possible, it’s far more reliable and requires less fiddling with DietPi.
Configure DietPi Automations
When I say automate I mean that we’re going to configure the DietPi image with a baseline set of software (on top of what is already provided). To do this we need to add a few lines to the
/boot/dietpi.txt file on the SD card we just flashed. We can also pre-configure Wifi too however for the purpose of this setup I’m assuming wired ethernet but the approach is similar.
If you open the
dietpi.txt you’ll find a load of configuration options and to make things easier you’ll probably find
⌘ + F is your friend here.
I recommend copying
dietpi.txt to your desktop then making the changes there, don’t forget to copy it back onto the SD card when you’re done though.
From this list we need to find the corresponding codes for Plex (42), Tautulli (146), RPi Monitor (66). We’ll also need some utilities to read exFAT drives (more on that later).
AUTO_SETUP_INSTALL_SOFTWARE_ID line for each softare you’re configuring, e.g:
These changes will automatically install the above software when DietPi runs its first time setup.
Next we need to create a small install script to allow the Pi to read from exFAT and other windows partitions (we’re likely adding an external harddrive which will have some flavour of Windows filesystem). To do this we need to create a text file called
Automation_Custom_Script.sh on the
/boot/ drive. The script will only have one line:
To enable this setup script we again need to modify
AUTO_SETUP_CUSTOM_SCRIPT_EXEC and change it to 1, e.g:
Finally we need to let DietPi know to use all our automations so, find
AUTO_SETUP_AUTOMATED and change it to 1.
You can download both dietpi.txt and Automation_Custom_Script.sh if you please.
There are a bunch of other options for the setup of the system so feel free to have a play. One line which might be worth changing is
AUTO_SETUP_NET_HOSTNAME which defaults to “DietPi”.
If you’ve decided to setup the automations from the previous section then this step should be seamless. Plug you SD card into your pi, make sure there’s ethernet, and the power it up. The setup process can take a bit of time but after about ~10 minutes you should be able to visit the IP address of the Pi on port 8888, e.g.
If you’re impatient / worried, like I was, you can always try SSH’ing to the Pi to make sure it’s behaving
ssh [email protected] with the password
dietpi. You should see something that looks like this:
After some time the setup should complete, once you’re able to visit the RPI-Mon page (
192.168.0.153:8888 in my case) you should be able to move onto the next, and final, step.
It’s worth SSH’ing into the Pi to check the first time setup has completed too (otherwise it will reboot as you’re configuring the other services)
Configure Plex and Tautulli
We can configure Plex and Tautulli. To do so we simply need to hit the local webservers for each of these services i.e the local webservers we just installed on the Pi.
For Plex visit:
For Tautulli visit:
(You IP address is likely to be different)
During the Plex setup it will ask you to add a library for your media, at this point you should connect your USB drives and click
Browse. What you should see is a bunch of directories none of which are your drive, why? Well Linux needs to mount USB drives to make them available to the operating system.
Ideally this would be handled automatically, howecer I’ve yet to find a good solution for this, though
usbmount looks promising.
Mounting Drives for Plex
To mount a drive on the Pi first SSH over to the machine
ssh [email protected] with the password
Once logged in we first need to create a folder for the drive to be mounted, run
sudo mkdir /media/my_drive to create the folder. Next we need to mount the actual drive, run
sudo fdisk -l and look for your drive (hint
Disk model is usually provied for USB drives).
When you’ve identified the drive we need to instruct linux where to mount it
All things being well the Pi should mount your drives and they will be available under
/media/ when you go back to Plex (refresh first).
Make sure to login with your Plex account, if you’re lucky you’ll be able to configure remote access (the port forwarding needed differs across routers but some will do it automatically.)
Once your Plex server is up and running you can start Tautulli.
Tautulli is a service that look at all the Plex server metadata to give you an overview of how much media is being watched, by whom and on what device - especially useful when sharing your Plex server with friends and family.
Sit back and enjoy
Plex Client Rpi4
That’s it, you should now be able to watch your media anywhere via one of the many Plex apps!
Install Plex On Rpi 4
I hope you enjoyed this guide, I would like it to be an entirely plug and play experience with the USB drives and I suspect I will do a followup post when I figure that part out. Feel free to reach me on Twitter with any feedback and enjoy your Pi powered media server.First appeared on Trusty Interior, last update 14 Mar 2021
The 'Secure Shell' protocol provides access to your Ubuntu Appliance and uses cryptographic keys to authenticate you to the device. You will need SSH software and keys.
Some versions of Windows 10 include an SSH client already, but if yours does not or you're unsure, follow these steps to install one.
OpenSSH client is an installable feature of Windows 10.
To install OpenSSH, start Settings then go to
Apps > Apps and Features > Manage Optional Features.
Scan this list to see if OpenSSH client is already installed. If not, at the top of the page select
Add a feature, then, to install the OpenSSH client, locate
OpenSSH Clientand click
Once the installation completes, return to
Apps > Apps and Features > Manage Optional Featuresand you should see the OpenSSH component(s) listed.
To install OpenSSH using PowerShell, first launch PowerShell as an Administrator. To make sure that the OpenSSH features are available for install type the command:
Get-WindowsCapability -Online ? Name -like 'OpenSSH*'
This should return:
Then, install the client features:
Rpi4 Plex 4k
Both commands should return: