CentOS下Jellyfin设置指南
sudo yum update -y确保系统为最新版本,避免兼容性问题。libicu(国际化支持)、fontconfig(字体渲染)等包,执行sudo yum install -y libicu fontconfig安装。sudo yum install -y epel-release(安装EPEL仓库);wget https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm(下载RPM Fusion免费源);rpm -ivh rpmfusion-free-release-7.noarch.rpm(安装源);sudo yum install -y ffmpeg ffmpeg-devel(安装FFmpeg及开发包)。wget https://repo.jellyfin.org/releases/server/centos/stable/web/jellyfin-web-10.8.9-1.el7.noarch.rpm;wget https://repo.jellyfin.org/releases/server/centos/stable/server/jellyfin-server-10.8.9-1.el7.x86_64.rpm;wget https://repo.jellyfin.org/releases/server/centos/stable/server/jellyfin-10.8.9-1.el7.x86_64.rpm。yum localinstall命令安装所有包(自动解决依赖):sudo yum localinstall jellyfin-web-*.rpm jellyfin-server-*.rpm jellyfin-*.rpm。docker pull jellyfin/jellyfin:latest获取最新版Jellyfin镜像。mkdir -p /srv/jellyfin/{config,cache,media}。docker run命令启动容器(映射端口、挂载目录):docker run -d --name jellyfin -p 8096:8096 --restart always --privileged -v /srv/jellyfin/config:/config -v /srv/jellyfin/cache:/cache -v /path/to/your/media:/media jellyfin/jellyfin:latest(/path/to/your/media替换为实际媒体路径)。sudo systemctl start jellyfin启动Jellyfin服务。sudo systemctl enable jellyfin,确保系统重启后自动启动。sudo systemctl status jellyfin确认服务运行正常(显示“active (running)”)。http://服务器IP:8096(默认端口),进入初始化向导。/media/movies),勾选“启用刮削”(自动获取海报、简介)。1900/udp)、UPnP等功能,方便智能设备访问。sudo firewall-cmd --zone=public --add-port=8096/tcp --permanent;sudo firewall-cmd --zone=public --add-port=8920/tcp --permanent(可选,用于加密访问);sudo firewall-cmd --zone=public --add-port=1900/udp --permanent;sudo firewall-cmd --zone=public --add-port=5353/udp --permanent。sudo firewall-cmd --reload使规则生效。sudo yum install -y nginx;sudo vi /etc/nginx/conf.d/jellyfin.conf,添加以下内容:server {
listen 80;
server_name your_domain.com; # 替换为你的域名或IP
location / {
proxy_pass http://localhost:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
sudo systemctl restart nginx。sudo yum install -y certbot python3-certbot-nginx;sudo certbot --nginx -d your_domain.com(替换为你的域名);jellyfin)对媒体文件夹是否有读写权限(chown -R jellyfin:jellyfin /path/to/media);国内网络需修改NAS hosts文件,解决TheMovieDB元数据搜刮问题。/etc/jellyfin/system.xml或Docker映射的/config/system.xml),禁用导致问题的功能(如“演员照片”)。systemctl status jellyfin)。