April 20, 2025
3 minutes read
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.
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.
/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.
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
).
sudo mkdir -p /media/usbdrive
usbdrive
can be anything. You can use your actual usb drive name for this.
For exFAT
:
sudo apt install exfat-fuse exfatprogs
For NTFS
:
sudo apt install ntfs-3g
/etc/fstab
(Based on Filesystem Type)Edit your fstab:
sudo nano /etc/fstab
exfat
drives:UUID=1234-ABCD /media/usbdrive exfat uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
ext4
drives:UUID=1234-ABCD /media/usbdrive ext4 defaults,nofail,x-systemd.automount 0 2
ntfs
drives:UUID=1234-ABCD /media/usbdrive ntfs-3g uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
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
sudo chown -R jellyfin:jellyfin /media/usbdrive
sudo chmod -R 755 /media/usbdrive
http://<your-pi-ip>:8096
/media/usbdrive
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.
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.
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
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:
Go
> Connect to Server
Type the following:
smb://<raspberrypi_ip>\usbonpi
If you are on Windows:
In the address bar, type the following:
\\<raspberrypi_ip>\usbonpi
fstab
.โ 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.