cover_image

Setup Jellyfin On Raspberry Pi - Home Media Server

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.


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

  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

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

  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

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

๐ŸŒ 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.


Copyright © 2024 | All rights reserved.