Jellyfin: Setup the Self-hosted Media Streaming Server with a Downloader and a File Manager
Video
Transcript
Hello, this is channel Easy Self Host. In this video we are going to run Jellyfin,
the free and open-source media streaming server that can stream your own media files to any of
your devices. This video will focus on basic setup with downloading or file managing capabilities
but will not cover advanced features like transcoding. And like always we are going
to run Jellyfin using Docker Compose and we'll set up proxy server with HTTPS. Now let's get started.
This is the Docker Compose file we're going to use to run Jellyfin. Like before we're going to
declare the Docker network proxy-net which is used to connect the Jellyfin server to our proxy server.
Next we have some Docker volumes. The first volume jellyfin-media is for storing media files.
By default the Docker volume lives in the server file system. So if your media files come from a
network share like NFS from another server, you can edit the driver options here to let your
container access those files. For the demo we are going to rely on the local file system for storage.
The other two volumes are for storing configurations and caches. Then let's define our Jellyfin service.
The Docker image we are going to use is from the official source. Then I configure the hard limit
for memory consumption for the Jellyfin server. With this setting the Jellyfin server will crash
and restart when it exceeds the memory limit. I've seen people mention that Jellyfin server will
sometimes use a lot of memory even without transcoding. So I add this setting to protect
other services. But if you are going to use transcoding or if you don't worry about its memory
usage, you can disable this setting. Then we're going to define the port and Docker network for
this service. And for the volume section we map all three of our Docker volumes to their directories.
And finally in this Docker Compose file we need to add this environment setting for the URL we
are intended to access the Jellyfin service. To properly set up this URL we're also going to set
up the DNS for our domain and the proxy server. I'm using Caddy for proxy so I add this proxy rule
to proxy the domain media.home.easyselfhost.com to the Jellyfin server with port 1896. For the DNS
setting I've always had this wildcard rule to map all the subdomains of home.easyselfhost.com to my
home server. After the configuration is ready we can go to the command line of our server and
navigate to the directory that has the Docker Compose file. And from here we can simply run
docker compose up -d to bring up the service. Then we need to refresh the Caddy config. Let's navigate
to the Caddy directory and run docker compose restart if your Caddy service is already running
or run docker compose up -d if it's the first time you're running Caddy server.
After this we can go to the browser and navigate to the domain name we've set up. Now we land in
the Jellyfin welcome page. From here we can start setting up our server. The first step is to add an
admin user and set up its password. Then we are going to set up our first media library.
A media library has its own content type like movies or music. With the proper content type
it's easier for Jellyfin to fetch metadata for your media files. Next we need to add folders
for the library. We've set up the /media directory for storing media files but it's likely
that we will have multiple libraries under this directory so it's better that we create some sub
folders under this directory. If you have file browser set up like my last video you can navigate
to the media folder and create a subfolder there. Otherwise you can use command line to do that.
Then we can go back to the Jellyfin and select the subfolder for storing movies. Then you will
have some metadata related setting. You can set them according to your location or preferences.
Then you can create your first media library. Now you can create some more libraries or continue
with the setting. You can always revisit this setting in the dashboard after the server is set
up. Now let's log in our account. After that you will see an empty library if you don't have files
in the folder already. There are multiple ways you can add media to your library. One simple way is
to upload files to your server using tools like file browser. We can simply drag and drop media
files here. This is my youtube video but to simulate real world situation let's change its
file name to a movie title. A good file name including title and a year can help Jellyfin
fetch its metadata. Now we can go back to Jellyfin and navigate to the dashboard to let the server scan
the library. Jellyfin will scan the libraries from time to time but you can also manually start
this operation. After this when we go to a library we can see our video get recognized as the 'Pulp Fiction'
movie. Here we can start a playback within the browser. Well, obviously it's still my youtube video.
While it's convenient to just upload files to our server it's not efficient if you want to download
media. Since that way you need to download the media and then re-upload it to the server. So it's
better that we set up a downloader that download files directly to our Jellyfin library. The tool
I'm presenting is called pyload and we can also set it up using docker compose. This is the docker
compose file for the pyload. Most importantly you need to add the Jellyfin media volume to here
so it can download files to that volume. The volume name from another docker compose file
starts with the directory name in this case 'jellyfin' and followed by an underscore and the
volume name from that compose file. For the pyload service the docker image is made by the linuxserver.io
project. We also need to add proxy-net to the networks so we can access it from our proxy server.
Here we also need to set these environments to let pyload run as root so it can access files
from Jellyfin volume. I'll have a future video to talk about a more secure way to do this. Then we
need to mount the Jellyfin media volume to the download folder of this container and of course
we also need to add a proxy setting for the pyload service. Then let's do our new service routine in
the command line by first starting the pyload service and then refresh the caddy proxy rule.
Now back to the browser and we can go to the pyload using its domain name. The default username
and password are both 'pyload'. The pyload web ui can be a little confusing if you just start using
it. To download the file you can start by clicking the plus sign. The package name actually specifies
the folder name you want to download the files. So in our case we can type in 'movies'. For the links
I have a fake movie link to use here. And now you can click 'add package' and the download will start.
After the download is finished you can navigate to the file section
and you will see the new file is downloaded under the movies directory. Then let's go back to
Jellyfin and scan the libraries again. Then we can go to library and see our new movie title
which is downloaded from a link directly. To watch your content on the server you will need to
download Jellyfin client softwares. On the Jellyfin website there is a list of recommended
clients including both first party and third party. Here we can download the desktop Jellyfin media
player. The download is hosted on github and you can choose your platform. After installing the
client software the first step is to connect to our Jellyfin server. We have domain name set up
so we can just enter our domain name. Then it's similar to the web ui you can log into your account
and start browsing your media. Clients on other platforms like smart tvs or mobile phones are very
similar. That's all for a basic setup of a Jellyfin server with file managing and downloading
capabilities. Please consider subscribing for content like this. You can find the configuration
files in this video on github and the link is in description below. Thank you for watching.
Resources
- https://github.com/easyselfhost/self-host/blob/main/apps/jellyfin/docker-compose.yml
- https://github.com/easyselfhost/self-host/blob/main/apps/pyload/docker-compose.yml
- https://github.com/easyselfhost/self-host/blob/main/apps/caddy/Caddyfile
- https://jellyfin.org
- https://docs.linuxserver.io/images/docker-pyload-ng
- https://youtu.be/M2E7KyLc2NU?si=QLw7kNyOfeWqDsZe