centos

Jellyfin在Centos上如何配置

小樊
42
2025-06-26 12:02:30
栏目: 智能运维

在CentOS上配置Jellyfin媒体服务器的步骤如下:

准备工作

  1. 更新系统

    sudo yum update -y
    
  2. 安装依赖包

    sudo yum install -y libicu fontconfig
    
  3. 安装FFmpeg(如果使用RPM包安装):

    • 下载静态编译的FFmpeg静态包:
      wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
      tar -xvf ffmpeg-git-amd64-static.tar.xz
      sudo cp ffmpeg-git-20200211-amd64-static/ffmpeg /usr/bin/
      sudo cp ffmpeg-git-20200211-amd64-static/ffprobe /usr/bin/
      

安装Jellyfin

  1. 使用RPM包安装

    • 添加EPEL仓库(如果使用CentOS 7):
      sudo yum install -y epel-release
      
    • 下载Jellyfin的RPM包并进行安装:
      wget -c https://repo.jellyfin.org/releases/server/centos/stable/web/jellyfin-web-10.8.9-1.el7.noarch.rpm
      wget -c https://repo.jellyfin.org/releases/server/centos/stable/server/jellyfin-server-10.8.9-1.el7.x86_64.rpm
      wget -c https://repo.jellyfin.org/releases/server/centos/stable/server/jellyfin-10.8.9-1.el7.x86_64.rpm
      sudo yum localinstall jellyfin-web-10.8.9-1.el7.noarch.rpm jellyfin-server-10.8.9-1.el7.x86_64.rpm jellyfin-10.8.9-1.el7.x86_64.rpm
      
  2. 使用Docker安装(可选):

    • 安装Docker:
      sudo yum install -y docker
      sudo systemctl start docker
      sudo systemctl enable docker
      
    • 拉取Jellyfin镜像:
      docker pull jellyfin/jellyfin:latest
      
    • 运行Jellyfin容器:
      mkdir -p /srv/jellyfin/{config,cache}
      docker run -d --name jellyfin -p 80:8096 --restart always --privileged true -v /srv/jellyfin/config:/config -v /srv/jellyfin/cache:/cache -v /path/to/your/media:/media jellyfin/jellyfin:latest
      

配置Jellyfin

  1. 启动和启用Jellyfin服务

    sudo systemctl start jellyfin
    sudo systemctl enable jellyfin
    
  2. 配置防火墙

    • 放行Jellyfin所需的端口:
      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
      
  3. 初始化Jellyfin

    • 访问Jellyfin的Web界面(默认IP: 8096),按照提示完成初始化设置,包括选择语言、用户名、密码、媒体库等。
  4. 配置SSL(可选)

    • 安装Certbot:
      sudo yum install -y certbot python3-certbot-nginx
      
    • 获取并安装SSL证书:
      sudo certbot --nginx -d your_domain
      
    • 配置Nginx反向代理(可选)。

注意事项

希望这些步骤能帮助你在CentOS上成功安装和配置Jellyfin媒体服务器。

0
看了该问题的人还看了