ubuntu

jellyfin在ubuntu上的安装步骤

小樊
46
2025-03-08 22:52:22
栏目: 智能运维
Ubuntu服务器限时活动,0元免费领! 查看>>

在Ubuntu上安装Jellyfin媒体服务器的步骤如下:

安装Jellyfin的步骤

  1. 更新系统并安装必要的包
sudo apt update
sudo apt upgrade
  1. 安装Docker(如果打算使用Docker来运行Jellyfin):
# 安装必要的依赖
sudo apt install apt-transport-https ca-certificates curl software-properties-common

# 添加 Docker 的GPG 密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# 添加 Docker 的稳定版仓库
sudo add-apt-repository "deb [archamd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# 更新软件包索引并安装 Docker
sudo apt update
sudo apt install docker-ce

# 启动 Docker 并设置为开机自启
sudo systemctl start docker
sudo systemctl enable docker
  1. 安装Jellyfin
sudo apt install jellyfin -y
  1. 验证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 OpenSSH
sudo ufw enable
sudo ufw allow "WWW Full"
sudo ufw status
  1. 安装Apache和Certbot(用于SSL配置,可选):
sudo apt install apache2 certbot python3-certbot-apache -y
sudo systemctl is-enabled apache2
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 you_email@gmail.com --no-eff-email --webroot -w /var/www/html -d your_domain
sudo nano /etc/apache2/sites-available/jellyfin.conf

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

<VirtualHost *:80>
    ServerName your_domain
    Redirect permanent / https://your_domain/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/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>
  1. 重启Apache
sudo systemctl restart apache2
  1. 访问Jellyfin

在浏览器中访问 http://your_domain:8096,你将看到Jellyfin的界面。

请注意,以上步骤是基于Ubuntu系统的标准安装流程,具体操作可能会因系统版本或特定需求而有所不同。在安装过程中,请确保遵循相关的安全指南和最佳实践。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

相关推荐:Jellyfin在Ubuntu上的配置步骤

0
看了该问题的人还看了