JELLYFIN - Install Script On Ubuntu 24.4: Difference between revisions
From IT-Arts.net
No edit summary |
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' " |
||
| Line 1: | Line 1: | ||
[[Category:Wiki]] | [[Category:Wiki]] | ||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
== install_jellyfin.sh == | == install_jellyfin.sh == | ||
Latest revision as of 07:11, 17 January 2026
install_jellyfin.sh
#!/bin/bash
# Exit on any error
set -e
# Function to print messages in green for success
function print_success() {
echo -e "\033[0;32m$1\033[0m"
}
# Function to print messages in red for errors
function print_error() {
echo -e "\033[0;31m$1\033[0m"
}
# Function to install dependencies
function install_dependencies() {
print_success "Installing required dependencies..."
sudo apt update
sudo apt upgrade -y
sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
ufw \
software-properties-common \
ffmpeg \
libssl-dev \
libcurl4-openssl-dev \
libmbedtls-dev \
libssl-dev \
libudev-dev
}
# Function to add Jellyfin repository and key
function add_jellyfin_repo() {
print_success "Adding Jellyfin repository..."
# Jellyfin GPG key
curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/jellyfin.gpg
# Add Jellyfin repo to sources list
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list
# Update package list to include Jellyfin repository
sudo apt update
}
# Function to install Jellyfin
function install_jellyfin() {
print_success "Installing Jellyfin..."
sudo apt install -y jellyfin
# Enable Jellyfin service to start on boot
sudo systemctl enable jellyfin
sudo systemctl start jellyfin
}
# Function to configure firewall (if UFW is enabled)
function configure_firewall() {
print_success "Configuring firewall (if UFW is enabled)..."
# Check if UFW is enabled
if sudo ufw status | grep -q "active"; then
sudo ufw allow 8096/tcp # Jellyfin default port
sudo ufw reload
print_success "Firewall configured to allow Jellyfin on port 8096."
else
print_error "UFW is not enabled. Skipping firewall configuration."
fi
}
# Function to check Jellyfin status
function check_jellyfin_status() {
print_success "Checking Jellyfin status..."
# Check if Jellyfin service is running
if systemctl is-active --quiet jellyfin; then
print_success "Jellyfin service is running."
else
print_error "Jellyfin service is not running. Please check the logs."
exit 1
fi
}
# Main Installation Procedure
function install_jellyfin_server() {
install_dependencies
add_jellyfin_repo
install_jellyfin
configure_firewall
check_jellyfin_status
print_success "Jellyfin installation and setup complete!"
print_success "Access Jellyfin at http://<Your_Server_IP>:8096"
}
# Run the installation function
install_jellyfin_server
exit 0
