ubuntu

jellyfin在ubuntu上运行吗

小樊
46
2025-03-10 23:11:51
栏目: 智能运维

Jellyfin可以在Ubuntu上运行。以下是在Ubuntu上安装和配置Jellyfin的详细步骤:

安装Jellyfin的步骤

  1. 更新系统并安装必要的包
sudo apt update
sudo apt upgrade
  1. 添加Jellyfin仓库
wget -O - https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | sudo apt-key add -
echo "deb [arch=$(dpkg --print-architecture)] https://repo.jellyfin.org/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
  1. 更新包列表
sudo apt update
  1. 安装Jellyfin
sudo apt install jellyfin -y
  1. 验证Jellyfin服务
sudo systemctl is-enabled jellyfin
sudo systemctl status jellyfin
  1. 管理Jellyfin服务
sudo systemctl start jellyfin
sudo systemctl stop jellyfin
sudo systemctl restart jellyfin
  1. 配置防火墙(可选):
sudo apt install ufw -y
sudo ufw allow 8096/tcp
sudo ufw enable
  1. 安装Apache和Certbot(可选,用于SSL配置)
sudo apt install apache2 certbot python3-certbot-apache -y
sudo systemctl is-enabled apache2
sudo a2enmod proxy proxy_http ssl proxy_wstunnel remoteip http2 headers
sudo systemctl restart apache2
  1. 设置Apache作为反向代理
sudo mkdir -p /var/www/html/jellyfin/public_html
sudo chown -R www-data:www-data /var/www/html/jellyfin/public_html
sudo certbot certonly --agree-tos --email your_email@gmail.com --no-eff-email --webroot -w /var/www/html -d your_domain
  1. 配置Apache虚拟主机
sudo nano /etc/apache2/sites-available/jellyfin.conf

在配置文件中插入以下内容,根据需要更改域名、SSL证书路径和服务器IP地址:

<VirtualHost *:80>
    ServerName your_domain
    Redirect permanent / https://your_domain/
    ErrorLog /var/log/apache2/your_domain-error.log
    CustomLog /var/log/apache2/your_domain-access.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerName your_domain
    DocumentRoot /var/www/html/jellyfin/public_html
    ProxyPreserveHost On
    ProxyPass "/.well-known/" "!"
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
    ProxyPass "/socket" "ws://0.0.0.0:8096/socket"
    ProxyPassReverse "/socket" "ws://0.0.0.0:8096/socket"
    ProxyPass "/" "http://0.0.0.0:8096/"
    ProxyPassReverse "/" "http://0.0.0.0:8096/"
</VirtualHost>

完成以上步骤后,您可以通过浏览器访问 http://your_domain:8096 来访问Jellyfin的Web界面,并进行相应的配置。

希望这些信息能帮助您在Ubuntu上成功运行Jellyfin。如果有任何问题,请参考Jellyfin的官方文档或相关社区支持。

0
看了该问题的人还看了