In this guide, we’ll walk through setting up a personal media server using Jellyfin
on a Raspberry Pi 5 running Ubuntu 24.04. We'll configure a USB drive as the media storage, mount it properly, auto-mount it at boot, and set up Samba so you can transfer media from your PC or laptop over the network. Great for anyone wanting a self-hosted Netflix-like experience.
Setting Up Jellyfin Media Server
📦 Step 1: Install Jellyfin
sudo apt update
curl -s https://repo.jellyfin.org/install-debuntu.sh | sudo bash
Once installed, Jellyfin runs on port 8096
by default.
Open it in your browser:
http://<your-pi-ip>:8096
Before setting up Jellyfin, lets go through other steps to add the media folders in Jellyfin server.
🔌 Step 2: Connect Your USB Drive
- Plug in your USB drive.
-
Ubuntu may auto-mount it under:
/media/<your-username>/<usb-name>
👉 This location is fine temporarily, but it can change or fail to mount after a reboot — which is not reliable for a media server.
🔍 Step 3: Identify the USB Drive and Its Filesystem
To list connected drives:
lsblk
To get UUID and filesystem type:
sudo blkid
Look for your USB device, something like:
/dev/sda1: UUID="1234-ABCD" TYPE="exfat"
Copy the UUID and note the TYPE (e.g., exfat
, ntfs
, ext4
, or vfat
).
📂 Step 4: Create a Permanent Mount Point
sudo mkdir -p /media/usbdrive
usbdrive
can be anything. You can use your actual usb drive name for this.
🛠 Step 5: Install Filesystem Support (if needed)
For exFAT
:
sudo apt install exfat-fuse exfatprogs
For NTFS
:
sudo apt install ntfs-3g
⚙️ Step 6: Configure Auto-Mount with /etc/fstab
(Based on Filesystem Type)
Edit your fstab:
sudo nano /etc/fstab
✅ For exfat
drives:
UUID=1234-ABCD /media/usbdrive exfat uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
✅ For ext4
drives:
UUID=1234-ABCD /media/usbdrive ext4 defaults,nofail,x-systemd.automount 0 2
✅ For ntfs
drives:
UUID=1234-ABCD /media/usbdrive ntfs-3g uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
✅ For vfat
(FAT32) drives:
UUID=1234-ABCD /media/usbdrive vfat uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
After saving, mount all drives:
sudo mount -a
Check if the drive mounted:
ls /media/usbdrive
🔑 Step 7: Fix Permissions (if needed)
sudo chown -R jellyfin:jellyfin /media/usbdrive
sudo chmod -R 755 /media/usbdrive
🎞 Step 8: Add USB Folder to Jellyfin
- Open
http://<your-pi-ip>:8096
- Go to Dashboard → Libraries
- Create a new library (e.g. "Movies")
-
Set the path to:
/media/usbdrive
Save and scan the library
{:.blockquote}
If you’re more old-school, you can simply disconnect the USB drive from your Raspberry Pi and connect it to another laptop to transfer files. But if you’d prefer to avoid that hassle and transfer files over the network, stick around — we’ll set up a Samba server to make file sharing seamless and easy.
Transfering Files
We can install Samba on Ubuntu to access the USB drive over the network from other PCs or laptops. However, currently only the jellyfin
user has full permission to modify or delete files on the USB drive.
To fix this, we’ll create a shared group, add both the jellyfin
and pi
users to it, and then mount the USB drive using this shared group to ensure proper access for both users.
📁 Step 9. Mount USB Drive as a Shared Group
-
Create and assign group:
sudo groupadd media sudo usermod -aG media pi sudo usermod -aG media jellyfin
-
FSTAB entry:
UUID=XXXX-XXXX /media/usbdrive exfat defaults,uid=pi,gid=media,umask=0002,nofail,x-systemd.automount 0 0
-
Reload:
sudo umount /media/usbdrive sudo mount -a
To check ownership:
ls -ld /media/usbdrive
🌐 Step 10. Set up Samba for File Transfers
-
Install Samba:
sudo apt install samba samba-common-bin
-
Create a new config block at the end of
/etc/samba/smb.conf
:Run:
sudo nano /etc/samba/smb.conf
Add the below config
[usbonpi] path = /media/usbdrive writeable = yes browseable = yes public = no read only = no guest ok = no force user = pi force group = pi create mask = 0777 directory mask = 0777 delete readonly = yes
-
Reload Samba Service:
sudo systemctl restart smbd
-
Add a Samba user:
sudo smbpasswd -a pi
Access the share via another PC:
If you are on Mac:
- Open Finder
- Go to
Go
>Connect to Server
-
Type the following:
smb://<raspberrypi_ip>\usbonpi
If you are on Windows:
- Open File Explorer
-
In the address bar, type the following:
\\<raspberrypi_ip>\usbonpi
📋 Summary
- We installed Jellyfin and accessed it via a browser.
- A USB drive was configured to auto-mount using
fstab
. - Permissions were assigned to allow both Jellyfin and the Samba-accessing user.
- A Samba server was set up for easy file transfer.
✅ You're All Set! 🎉
Your Raspberry Pi is now a full-fledged Jellyfin server with a persistent, auto-mounted USB drive as the media library.