Hosting a media server with Jellyfin

I've been using Jellyfin to stream my collection of movies and shows from my PC to my laptop, phone, and TV. Jellyfin is an open-source media server that makes local media accessible across devices through a neatly packaged web interface.
My Jellyfin server is entirely local; it can only be accessed from clients connected to my home internet. Of course, it's always possible to make your server accessible from beyond your local network.
Quick aside: I collect music, movies, and TV shows because I prefer owning media over renting from streaming services.
Streaming seems reliable until one of your favorite bands removes their music from Spotify in protest of company ethics, or Netflix delists a bunch of titles you were dying to watch.
Owning media is also totally free.
Jellyfin's features
Jellyfin looks and feels premium out of the box. The interface is neatly organized and ported nicely across platforms. Since my server is limited to my local network, streaming speeds feel near instantaneous.
As long as your media is organized properly, Jellyfin automatically fetches cover art, genres, acting credits, review scores, and other metadata for all your movies and shows. This is by far my favorite feature! 🐤

Jellyfin has dedicated clients for iOS, Android, Roku, and more. The Chromecast app definitely beats loading a USB drive to watch a movie on the TV.
The server supports multiple users and supports customizable permissions to control access to specific libraries. For each user, Jellyfin keeps track of what you've watched, and where you left off on unfinished movies or episodes.
The project also features a plugin for sharing e-books, audiobooks, and comics, which I'm tempted to try out.
Networking improvements
Jellyfin itself was easy to set up and works great, but I always find something to complain about. My server's initial address was 192.168.1.159:8096
, which is so NOT sexy. I want to type in words, not numbers. This is not a Jellyfin problem; this is a computer networking problem.
A human-readable address using DNS
Luckily, my router supports adding custom Domain Name System (DNS) entries. I added one that redirects local requests to jellyfin.local
to the server's IP address at 192.168.1.159
. With DNS configured, the address becomes jellyfin.local:8096
.
This is a huge improvement, but the port number is still there! I guess DNS doesn't support binding domain names to specific ports. We'll need another technology to eliminate the port number from the address.
Introducing a reverse proxy
A reverse proxy is one such approach to getting rid of that pesky port part. The proxy server acts as an intermediate step between the client and the Jellyfin server. I chose to use Caddy as my reverse proxy server, but it's incredibly customizable and can do a lot more than that.
I decided to set up the reverse proxy server on my Raspberry Pi 4, since I eventually want to migrate the Jellyfin server from my PC to the Pi. I set it up with Caddy's reverse proxy guide. Let me explain my config file:
# ~/Caddyfile
jellyfin.local {
# Handle error codes 5XX
handle_errors 5xx {
respond "Error: {err.status_code} {err.status_text}. -> Is the Jellyfin server up?"
}
# Generic error handling
handle_errors {
respond "RIP BOZO. Error: {err.status_code} {err.status_text}"
}
reverse_proxy clint.local:8096 # Jellyfin server address
}
pi.local {
respond "Hello from the pi :3"
}
I configured my router's DNS again so that jellyfin.local
and pi.local
both correspond to the Pi's IP. Caddy catches incoming HTTP/HTTPS requests and is configured to respond depending on which domain name was used.
An HTTP/HTTPS request using pi.local
doesn't do much; Caddy just returns a string. But for requests using jellyfin.local
, Caddy will serve the Jellyfin server to the client.
In other words, to access my Jellyfin server, all I need to type in is jellyfin.local
. The request is received by the Pi, then processed by Caddy to serve the media server hosted on my PC.
Into the future
I'm very happy with Jellyfin, and I can't wait to grow my film collection!
Eventually, the reverse proxy and media server will live on a dedicated machine. The Pi will be my testing ground for hosting a reverse proxy, file server, and media server simultaneously. I'll consider upgrading hardware depending on the Pi's performance.