Jellyfin is a powerful, open-source media server designed for self-hosting. It enables users to centralize and stream their media libraries while retaining complete control over their data. Unlike commercial solutions, Jellyfin offers unlimited customization and freedom from licensing restrictions. This guide provides hands-on steps to install, configure, and manage Jellyfin, covering everything from reverse proxies to backups and updates.
Installing Jellyfin
π¦ Docker/Docker Compose Setup
Using Docker simplifies Jellyfinβs deployment and management. Below is a docker-compose.yml
file to set up Jellyfin with proper volume mappings for persistent storage and port configurations.
version: '3.8'
services:
jellyfin:
container_name: jellyfin
image: jellyfin/jellyfin:latest
restart: unless-stopped
ports:
- "8096:8096" # Web interface and streaming
- "8920:8920" # Optional: HTTPS traffic
volumes:
- ./config:/config # Configuration data
- ./cache:/cache # Cache directory
- /path/to/media:/media # Media library
environment:
- TZ=America/New_York # Set your timezone
Run the following commands to deploy Jellyfin:
mkdir jellyfin && cd jellyfin
nano docker-compose.yml # Paste the above content into this file
docker-compose up -d # Start Jellyfin in detached mode
Access Jellyfin via http://<your-server-ip>:8096
.
π Manual Installation
For a direct installation on a Linux server, follow these steps:
- Add the Jellyfin repository and install required packages:
sudo apt update
sudo apt install apt-transport-https gnupg
wget -O - https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | sudo tee /usr/share/keyrings/jellyfin.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/jellyfin.gpg] https://repo.jellyfin.org/debian bullseye main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
sudo apt update
sudo apt install jellyfin
- Start the Jellyfin service:
sudo systemctl start jellyfin
sudo systemctl enable jellyfin
Access Jellyfin via http://<your-server-ip>:8096
.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
Set up an Nginx server block to route traffic to Jellyfin. This configuration assumes Jellyfin is running on http://localhost:8096
.
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Save this file as /etc/nginx/sites-available/jellyfin
and create a symbolic link:
sudo ln -s /etc/nginx/sites-available/jellyfin /etc/nginx/sites-enabled/
sudo nginx -t # Test the configuration
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your Jellyfin instance with Let's Encrypt:
- Install Certbot:
sudo apt install certbot python3-certbot-nginx
- Generate and apply SSL certificates:
sudo certbot --nginx -d yourdomain.com
- Automate certificate renewals:
sudo systemctl enable certbot.timer
π οΈ Testing and Reloading Nginx
Verify the configuration:
sudo nginx -t
sudo systemctl reload nginx
Visit https://yourdomain.com
to access Jellyfin securely.
Logging and Debugging Jellyfin
ποΈ Enabling Debug Logs
To enable debug logging, modify the Jellyfin configuration file (/etc/jellyfin/system.xml
for manual installs):
<LogLevel>Debug</LogLevel>
Restart Jellyfin to apply:
sudo systemctl restart jellyfin
π Viewing Logs
For Docker users:
docker logs -f jellyfin
For manual installations:
tail -f /var/log/jellyfin/server.log
π οΈ Troubleshooting Common Issues
Look for specific errors in the logs (e.g., missing media files, transcoding failures). Resolve issues by checking file permissions or installing missing dependencies.
π€ Exporting Logs
Use this command to compress and export logs for external analysis:
tar -czvf jellyfin_logs.tar.gz /var/log/jellyfin/
Backup and Restore
ποΈ File-Based Backups
Backup configuration and metadata:
tar -czvf jellyfin_backup.tar.gz /path/to/config /path/to/cache
Restore by extracting:
tar -xzvf jellyfin_backup.tar.gz -C /
π Database Backups
For SQLite-based Jellyfin installations, backup the database:
cp /path/to/config/data/library.db /path/to/backup/
Restore the database:
cp /path/to/backup/library.db /path/to/config/data/
π Automated Backup Scripts
Automate backups with a cron job:
crontab -e
0 0 * * * tar -czvf /path/to/backups/jellyfin_$(date +\%F).tar.gz /path/to/config /path/to/cache
Updating and Upgrading Jellyfin
β¬οΈ Updating Docker Images
Update Jellyfin by pulling the latest Docker image:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
For manual installations, upgrade via the package manager:
sudo apt update
sudo apt upgrade jellyfin
π Checking for Updates
Check for updates in the Jellyfin web interface under Dashboard > Updates or monitor the official Jellyfin GitHub releases.
Leveraging Jellyfinβs Unique Features
π§ Enabling APIs
Enable Jellyfinβs APIs for external integrations via Dashboard > API Keys
. Use the generated API key for automation:
curl -H "X-Emby-Token: YOUR_API_KEY" http://localhost:8096/emby/Users
π Advanced Configurations
Enable hardware acceleration for transcoding by editing /etc/jellyfin/ffmpeg.json
(manual installs) or passing GPU-specific flags in Docker:
devices:
- /dev/dri:/dev/dri
Enable plugins via the Jellyfin web interface under Dashboard > Plugins, such as trakt.tv for media scrobbling.
Wrapping Up
Self-hosting Jellyfin provides an unparalleled level of control and customization for your media streaming needs. By following this guide, youβve learned how to securely install, configure, and manage your Jellyfin instance while leveraging its unique features. Begin experimenting with the provided examples and enjoy the power of owning your media server!