Setup Jellyfin On Raspberry Pi - Home Media Server
Shashank

Shashank @bekaar_coder

About: Automating...

Joined:
Jun 7, 2018

Setup Jellyfin On Raspberry Pi - Home Media Server

Publish Date: Apr 20
0 0

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
Enter fullscreen mode Exit fullscreen mode

Once installed, Jellyfin runs on port 8096 by default.

Open it in your browser:

http://<your-pi-ip>:8096
Enter fullscreen mode Exit fullscreen mode

Before setting up Jellyfin, lets go through other steps to add the media folders in Jellyfin server.


🔌 Step 2: Connect Your USB Drive

  1. Plug in your USB drive.
  2. 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
Enter fullscreen mode Exit fullscreen mode

To get UUID and filesystem type:

sudo blkid
Enter fullscreen mode Exit fullscreen mode

Look for your USB device, something like:

/dev/sda1: UUID="1234-ABCD" TYPE="exfat"
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

For NTFS:

sudo apt install ntfs-3g
Enter fullscreen mode Exit fullscreen mode

⚙️ Step 6: Configure Auto-Mount with /etc/fstab (Based on Filesystem Type)

Edit your fstab:

sudo nano /etc/fstab
Enter fullscreen mode Exit fullscreen mode

✅ For exfat drives:

UUID=1234-ABCD /media/usbdrive exfat uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
Enter fullscreen mode Exit fullscreen mode

✅ For ext4 drives:

UUID=1234-ABCD /media/usbdrive ext4 defaults,nofail,x-systemd.automount 0 2
Enter fullscreen mode Exit fullscreen mode

✅ For ntfs drives:

UUID=1234-ABCD /media/usbdrive ntfs-3g uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
Enter fullscreen mode Exit fullscreen mode

✅ For vfat (FAT32) drives:

UUID=1234-ABCD /media/usbdrive vfat uid=jellyfin,gid=jellyfin,umask=0022,nofail,x-systemd.automount 0 0
Enter fullscreen mode Exit fullscreen mode

After saving, mount all drives:

sudo mount -a
Enter fullscreen mode Exit fullscreen mode

Check if the drive mounted:

ls /media/usbdrive
Enter fullscreen mode Exit fullscreen mode

🔑 Step 7: Fix Permissions (if needed)

sudo chown -R jellyfin:jellyfin /media/usbdrive
sudo chmod -R 755 /media/usbdrive
Enter fullscreen mode Exit fullscreen mode

🎞 Step 8: Add USB Folder to Jellyfin

  1. Open http://<your-pi-ip>:8096
  2. Go to Dashboard → Libraries
  3. Create a new library (e.g. "Movies")
  4. Set the path to:

    /media/usbdrive
    
  5. 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

  1. Create and assign group:

    sudo groupadd media
    sudo usermod -aG media pi
    sudo usermod -aG media jellyfin
    
  2. FSTAB entry:

    UUID=XXXX-XXXX  /media/usbdrive  exfat  defaults,uid=pi,gid=media,umask=0002,nofail,x-systemd.automount  0  0
    
  3. Reload:

    sudo umount /media/usbdrive
    sudo mount -a
    

To check ownership:

ls -ld /media/usbdrive
Enter fullscreen mode Exit fullscreen mode

🌐 Step 10. Set up Samba for File Transfers

  1. Install Samba:

    sudo apt install samba samba-common-bin
    
  2. 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
    
  3. Reload Samba Service:

    sudo systemctl restart smbd
    
  4. Add a Samba user:

    sudo smbpasswd -a pi
    

Access the share via another PC:

If you are on Mac:

  1. Open Finder
  2. Go to Go > Connect to Server
  3. Type the following:

    smb://<raspberrypi_ip>\usbonpi
    

If you are on Windows:

  1. Open File Explorer
  2. 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.

Comments 0 total

    Add comment