Jellyfin serves your films and music to any device on the network, through a web page on port 8096. It runs as its own user, so it can only read files that user is allowed to read. A firewall decides which ports can be reached.
You have films on the Pi and want to watch them on the TV. What has to be true?
Install software with apt· On a Pi you add programs with apt, from a software source on the internet.
A media server is a service (lesson 4) that listens on a port, a numbered door on the Pi (Names and addresses in Security and privacy). Devices find the Pi by name or address, then knock on the right port. Port 22 is ssh, 445 is Samba and 8096 is Jellyfin.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Private films
TryTry it on the board and compare the result with your prediction.
Try: install and look
Was your prediction right?
Try it yourselfYour edits are saved in this browser.
Install jellyfin (the lists are already up to date), then run ss -tln to see which ports have a service.
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: Where the films go
Worked exampleBefore each step, say what you think comes next.
sudo apt install jellyfininstall it and start the service (on a real Pi, add Jellyfin's repository first).
sudo mv Videos/holiday.mp4 /srv/mediamove the film where the jellyfin user can read it.
sudo ufw allow 8096let other devices reach the web page.
http://raspberrypi.local:8096what you type into the TV or laptop's browser.
Now try it yourself.
Sam's library is empty. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: change one thing
Try it yourselfYour edits are saved in this browser.
Move /home/pi/Videos/holiday.mp4 into /srv/media so that jellyfin can read it.
Use the board. This ticks when you get there.
The firewall is on and blocks everything. Let other devices reach Jellyfin on port 8096.
Use the board. This ticks when you get there.
Stop the Jellyfin service. Check with ss -tln that nothing listens on 8096.
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Practise
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
A media server
Then: on a real Pi, add Jellyfin's repository (its install page gives the commands), then open http://raspberrypi.local:8096 from another device.
Try it yourselfYour edits are saved in this browser.
Jellyfin serves your films and music to any device on the network, through a web page on port 8096. It runs as its own user, so it can only read files that user is allowed to read. A firewall decides which ports can be reached. About 40 minutes.
I can explain why a service cannot read a private home folder.
I can let one port through a firewall and no others.
Before class
Try the boards yourselves.
The one idea: a service runs as a user and gets only that user's rights; a firewall decides which ports can be reached. This links permissions (lesson 3) and ports (Networks).
Simplifications: the pretend Pi has Jellyfin in its apt list. A real Raspberry Pi OS does not: add Jellyfin's own repository first (see jellyfin.org install page), which downloads a key, and then sudo apt install jellyfin. Jellyfin also asks for a first-run setup in the browser (an admin account, a library folder). The board shows only what matters for the lesson.
Taught: Jellyfin (free, open source, no account). Other options to name: Plex (free to play your own media; some features need a Plex account or a paid Plex Pass), Emby (some features need a licence), Kodi (plays on one device, not a server). On a Pi, transcoding (changing a video's format on the fly) is slow, so use files the devices can play directly.
With internet: metadata (posters, descriptions) is fetched from the internet. Reaching your server away from home should use a VPN (Tailscale or WireGuard), not an opened router port: an open port is scanned within minutes.
Running the lesson
Predict: wrong answers think a service is all-powerful.
Try: ask which of the listed ports is which.
Worked example: stop at the library bug and ask whose permissions apply.
Vary: after the firewall task, ask what else is blocked.
Make: ask what would make this unsafe to put on the internet.
The hard part (on purpose)
Seeing the service as a user. Ask: whose account runs it, and what may that account read?
When students get stuck
Jellyfin finds no films. Ask: Who owns the folder? Can the jellyfin user open it? Fix: Move the films to /srv/media.
Other devices cannot connect. Ask: Is the service running? Is the port allowed? Fix: systemctl status jellyfin, sudo ufw allow 8096.
Stretch and support
Stretch: Find out what transcoding is and why a Pi is slow at it.
Support: A card: the user, the folder, the port.
Where it leads
Links: Networks (ports); Accounts, groups and sudo; Services; next: Keep it running.
What each step is for
private films: Committing to what a service can read tests the new move: a service is a user too, and permissions apply to it.
Try: install and look: Installing it and listing the ports settles what it does.
Worked example: Where the films go: Following the method once, then finding where a plausible account goes wrong, models the new move.
Vary: change one thing: Each task changes one thing: where the film is, the firewall, and stopping the service.
Practise: Choosing ports and fixes without the board is the same move in new forms, plus a review of shares.
a media server: Combining install, location and firewall is the whole move.