溫馨提示×

jellyfin在ubuntu上的安裝步驟

小樊
78
2025-03-08 22:52:22
欄目: 智能運維

在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服務
  • 啟動Jellyfin:
sudo systemctl start jellyfin
  • 停止Jellyfin:
sudo systemctl stop jellyfin
  • 重啟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作為反向代理
  • 創建Jellyfin的web根目錄并設置權限:
sudo mkdir -p /var/www/html/jellyfin/public_html
sudo chown -R www-data:www-data /var/www/html/jellyfin/public_html
  • 使用Certbot為你的域名獲取SSL證書:
sudo certbot certonly --agree-tos --email you_email@gmail.com --no-eff-email --webroot -w /var/www/html -d your_domain
  • 配置Apache虛擬主機:
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系統的標準安裝流程,具體操作可能會因系統版本或特定需求而有所不同。在安裝過程中,請確保遵循相關的安全指南和最佳實踐。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女