How to build a media server (Jellyfin) on Linux (OpenSUSE)
This article is a translation of the following my article:
Original: メディアサーバー(Jellyfin)をLinux(OpenSUSE)上で構築する方法
* Translated automatically by Google.
* Please note that some links or referenced content in this article may be in Japanese.
* Comments in the code are basically in Japanese.
by bokumin
How to Set Up a Jellyfin Media Server on Linux(SUSE TW)
Introduction
I wanted to be able to centrally manage the music files I had on hand, so I built jellyfin using a web server (OpenSUSE) on my home-built PC. I will show you how to install it.
Advantages and disadvantages of installation methods
When installing jellyfin on OpenSUSE, the mainstream methods are snap, zypper, docker, etc.
| Method | Advantages | Disadvantages |
|---|---|---|
| Snap | ・Easy to install ・Automatic update possible ・Clear privilege management | ・Slightly slow to start ・Uses a lot of disk space ・Special file path |
| zypper strong> | ・Integrated into the system ・Lightweight ・Can use traditional Linux management methods | ・Not in official repositories ・Requires a community-managed repository |
| Do cker | ・Does not pollute the environment ・Easy to migrate OS ・Easy to update | ・Some overhead ・Initial settings are a little complicated |
Personally, I recommend using the following.
Beginners: Snap (the easiest)
Those who prefer traditional package management: zypper
Those who operate multiple services: Docker (can centralize management)
We will introduce each of them below.
Installation instructions for Snap
The installation method for Snap differs depending on the distribution, but in the OpenSUSE I use, there is a repository for each package at this URL (https://download.opensuse.org/repositories/system:/snappy/), so I used it as a reference.
In the case of TW, it is a rolling release model, so there is no fixed number, and you can obtain Snaps using the command below.
#zypperにレポジトリ追加
sudo zypper ar https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed/ snappy
sudo zypper --gpg-auto-import-keys refresh
sudo zypper dup --from snappy
sudo zypper install snapd
Snap acquisition is completed with the above command. Next, set Snap to start automatically.
#起動時にsnapが起動しているようにする
sudo systemctl enable --now snapd
#OpenSUSEは追加でsnapd.apparmor サービスを有効にして開始する必要がある
sudo systemctl enable --now snapd.apparmor
Next, we will install jellyfin.
This time, we will install something called itrue-jellyfin, which was created by community development.
sudo snap install itrue-jellyfin
#ホームディレクトリへのアクセス許可
snap connect itrue-jellyfin:home
#USBドライブやメモリ―カードへのアクセス許可
snap connect itrue-jellyfin:removable-media
#マウントポイントを確認する権限の許可
snap connect itrue-jellyfin:mount-observe
#firewall設定の変更許可
snap connect itrue-jellyfin:firewall-control
This completes the installation for snap.
Installation instructions for zypper
There is also a way to install Jellyfin using zypper. However, the official OpenSUSE repositories do not include Jellyfin, so you will need to add a community-maintained third-party repository. For TW, install as follows.
# リポジトリ追加
sudo zypper addrepo https://download.opensuse.org/repositories/home:furlongm:branches/openSUSE_Tumbleweed/home:furlongm:branches.repo
# リポジトリ更新
sudo zypper refresh
# Jellyfinインストール
sudo zypper install jellyfin
# サービスの有効化と起動
sudo systemctl enable --now jellyfin
For Leap (15.6), it is as follows.
# リポジトリ追加
sudo zypper addrepo https://download.opensuse.org/repositories/home:ecsos:server/15.6/home:ecsos:server.repo
# リポジトリ更新
sudo zypper refresh
# Jellyfinインストール
sudo zypper install jellyfin
# サービスの有効化と起動
sudo systemctl enable --now jellyfin
This completes the installation for zypper.
Installation instructions for Docker
Installation with Docker
Docker allows you to operate Jellyfin without polluting the system. It’s easy to update, and it’s easy to migrate servers across other OSs.
First, let’s install Docker.
*Please skip if Docker is already installed
# Dockerのインストール
sudo zypper install docker
# Dockerサービスの有効化
sudo systemctl enable --now docker
# 現在のユーザーをdockerグループに追加(sudo不要で実行できるようにする)
sudo usermod -aG docker $USER
# 再ログインして反映
Create the docker-compose.yml file.
version: '3.8'
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
network_mode: host
volumes:
- /home/username/jellyfin/config:/config
- /home/username/jellyfin/cache:/cache
- /home/username/Music:/media/music
- /home/username/Videos:/media/videos
restart: unless-stopped
environment:
- TZ=Asia/Tokyo
# path部分は実際のディレクトリに修正してください
# media部分は実際に存在する音楽や動画が置いてあるディレクトリを指定してください
After creating the above file, start it with the following command.
# Docker Composeのインストール
sudo zypper install docker-compose
# Jellyfinの起動
docker-compose up -d
# ログの確認
docker-compose logs -f
There is also a way to start using Docker commands without using yml.
docker run -d \
--name jellyfin \
--network host \
-v /home/username/jellyfin/config:/config \
-v /home/username/jellyfin/cache:/cache \
-v /home/username/Music:/media/music \
-v /home/username/Videos:/media/videos \
-v /mnt/external/Movies:/media/movies \
-e TZ=Asia/Tokyo \
--restart unless-stopped \
jellyfin/jellyfin:latest
# path部分は実際のディレクトリに修正してください
This completes the installation for Docker.
I think these are the main ways to install jellyfin on OpenSUSE, but I hope everyone can choose their favorite method.
After installation
Jellyfin uses port 8096 by default, so if you have configured ports with a firewall, etc., please make sure to open port 8096.
After that, enter and access “localhost:8096” on the browser of your smartphone or PC, and perform the initial settings. *In the initial settings, it is necessary to create an administrator user, so it is better to avoid creating an external user at this stage.
At the end
We introduced various methods of installing Jellyfin on OpenSUSE.
Jellyfin is a highly functional media server that can manage music, videos, and photos. Please choose according to your own environment and preferences.
Music files are subject to copyright, so please use them for personal use only.
End